Scratch架空鉄道Wiki scratchrailwaywiki https://scratchrailway.miraheze.org/wiki/%E3%83%A1%E3%82%A4%E3%83%B3%E3%83%9A%E3%83%BC%E3%82%B8 MediaWiki 1.41.0 first-letter メディア 特別 トーク 利用者 利用者・トーク Scratch架空鉄道Wiki Scratch架空鉄道Wiki・トーク ファイル ファイル・トーク MediaWiki MediaWiki・トーク テンプレート テンプレート・トーク ヘルプ ヘルプ・トーク カテゴリ カテゴリ・トーク モジュール モジュール・トーク テンプレート:Draw 10 76 164 2014-01-05T11:51:57Z ja>Ak from the villa 0 [[en:Template:Draw]] 20:23, 6 April 2013‎ (UTC) をコピペして{{Documentation}}のリンク先のみ改変 wikitext text/x-wiki <noinclude>{| class="wikitable" |- |</noinclude>style="background:#c5d2ea; color:black; vertical-align:middle; text-align:{{{align|center}}}; {{{style|}}}" class="table-draw" |{{{1|}}}<noinclude> |} {{Documentation|Template:Table cell templates}} </noinclude> abb380cae60944a305fc60fb3f4e1d006a534832 テンプレート:Cot 10 54 120 2015-05-29T05:43:35Z ja>K-iczn 0 [[WP:AES|←]][[Template:Collapse top]]へのリダイレクト wikitext text/x-wiki #転送 [[Template:Collapse top]] b43f038b7d7b98c4a285da4aa7d475ecebe82317 モジュール:Arguments 828 11 34 2016-03-06T15:05:00Z ja>Rxy 0 「[[モジュール:Arguments]]」を保護しました: [[WP:HRT|影響が特に大きいテンプレート]]: 現時点で 595,617 ページからのテンプレート読み込み ([編集=管理者のみに許可] (無期限) [移動=管理者の... Scribunto text/plain -- This module provides easy processing of arguments passed to Scribunto from -- #invoke. It is intended for use by other Lua modules, and should not be -- called from #invoke directly. local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local arguments = {} -- Generate four different tidyVal functions, so that we don't have to check the -- options every time we call it. local function tidyValDefault(key, val) if type(val) == 'string' then val = val:match('^%s*(.-)%s*$') if val == '' then return nil else return val end else return val end end local function tidyValTrimOnly(key, val) if type(val) == 'string' then return val:match('^%s*(.-)%s*$') else return val end end local function tidyValRemoveBlanksOnly(key, val) if type(val) == 'string' then if val:find('%S') then return val else return nil end else return val end end local function tidyValNoChange(key, val) return val end local function matchesTitle(given, title) local tp = type( given ) return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title end local translate_mt = { __index = function(t, k) return k end } function arguments.getArgs(frame, options) checkType('getArgs', 1, frame, 'table', true) checkType('getArgs', 2, options, 'table', true) frame = frame or {} options = options or {} --[[ -- Set up argument translation. --]] options.translate = options.translate or {} if getmetatable(options.translate) == nil then setmetatable(options.translate, translate_mt) end if options.backtranslate == nil then options.backtranslate = {} for k,v in pairs(options.translate) do options.backtranslate[v] = k end end if options.backtranslate and getmetatable(options.backtranslate) == nil then setmetatable(options.backtranslate, { __index = function(t, k) if options.translate[k] ~= k then return nil else return k end end }) end --[[ -- Get the argument tables. If we were passed a valid frame object, get the -- frame arguments (fargs) and the parent frame arguments (pargs), depending -- on the options set and on the parent frame's availability. If we weren't -- passed a valid frame object, we are being called from another Lua module -- or from the debug console, so assume that we were passed a table of args -- directly, and assign it to a new variable (luaArgs). --]] local fargs, pargs, luaArgs if type(frame.args) == 'table' and type(frame.getParent) == 'function' then if options.wrappers then --[[ -- The wrappers option makes Module:Arguments look up arguments in -- either the frame argument table or the parent argument table, but -- not both. This means that users can use either the #invoke syntax -- or a wrapper template without the loss of performance associated -- with looking arguments up in both the frame and the parent frame. -- Module:Arguments will look up arguments in the parent frame -- if it finds the parent frame's title in options.wrapper; -- otherwise it will look up arguments in the frame object passed -- to getArgs. --]] local parent = frame:getParent() if not parent then fargs = frame.args else local title = parent:getTitle():gsub('/sandbox$', '') local found = false if matchesTitle(options.wrappers, title) then found = true elseif type(options.wrappers) == 'table' then for _,v in pairs(options.wrappers) do if matchesTitle(v, title) then found = true break end end end -- We test for false specifically here so that nil (the default) acts like true. if found or options.frameOnly == false then pargs = parent.args end if not found or options.parentOnly == false then fargs = frame.args end end else -- options.wrapper isn't set, so check the other options. if not options.parentOnly then fargs = frame.args end if not options.frameOnly then local parent = frame:getParent() pargs = parent and parent.args or nil end end if options.parentFirst then fargs, pargs = pargs, fargs end else luaArgs = frame end -- Set the order of precedence of the argument tables. If the variables are -- nil, nothing will be added to the table, which is how we avoid clashes -- between the frame/parent args and the Lua args. local argTables = {fargs} argTables[#argTables + 1] = pargs argTables[#argTables + 1] = luaArgs --[[ -- Generate the tidyVal function. If it has been specified by the user, we -- use that; if not, we choose one of four functions depending on the -- options chosen. This is so that we don't have to call the options table -- every time the function is called. --]] local tidyVal = options.valueFunc if tidyVal then if type(tidyVal) ~= 'function' then error( "bad value assigned to option 'valueFunc'" .. '(function expected, got ' .. type(tidyVal) .. ')', 2 ) end elseif options.trim ~= false then if options.removeBlanks ~= false then tidyVal = tidyValDefault else tidyVal = tidyValTrimOnly end else if options.removeBlanks ~= false then tidyVal = tidyValRemoveBlanksOnly else tidyVal = tidyValNoChange end end --[[ -- Set up the args, metaArgs and nilArgs tables. args will be the one -- accessed from functions, and metaArgs will hold the actual arguments. Nil -- arguments are memoized in nilArgs, and the metatable connects all of them -- together. --]] local args, metaArgs, nilArgs, metatable = {}, {}, {}, {} setmetatable(args, metatable) local function mergeArgs(tables) --[[ -- Accepts multiple tables as input and merges their keys and values -- into one table. If a value is already present it is not overwritten; -- tables listed earlier have precedence. We are also memoizing nil -- values, which can be overwritten if they are 's' (soft). --]] for _, t in ipairs(tables) do for key, val in pairs(t) do if metaArgs[key] == nil and nilArgs[key] ~= 'h' then local tidiedVal = tidyVal(key, val) if tidiedVal == nil then nilArgs[key] = 's' else metaArgs[key] = tidiedVal end end end end end --[[ -- Define metatable behaviour. Arguments are memoized in the metaArgs table, -- and are only fetched from the argument tables once. Fetching arguments -- from the argument tables is the most resource-intensive step in this -- module, so we try and avoid it where possible. For this reason, nil -- arguments are also memoized, in the nilArgs table. Also, we keep a record -- in the metatable of when pairs and ipairs have been called, so we do not -- run pairs and ipairs on the argument tables more than once. We also do -- not run ipairs on fargs and pargs if pairs has already been run, as all -- the arguments will already have been copied over. --]] metatable.__index = function (t, key) --[[ -- Fetches an argument when the args table is indexed. First we check -- to see if the value is memoized, and if not we try and fetch it from -- the argument tables. When we check memoization, we need to check -- metaArgs before nilArgs, as both can be non-nil at the same time. -- If the argument is not present in metaArgs, we also check whether -- pairs has been run yet. If pairs has already been run, we return nil. -- This is because all the arguments will have already been copied into -- metaArgs by the mergeArgs function, meaning that any other arguments -- must be nil. --]] if type(key) == 'string' then key = options.translate[key] end local val = metaArgs[key] if val ~= nil then return val elseif metatable.donePairs or nilArgs[key] then return nil end for _, argTable in ipairs(argTables) do local argTableVal = tidyVal(key, argTable[key]) if argTableVal ~= nil then metaArgs[key] = argTableVal return argTableVal end end nilArgs[key] = 'h' return nil end metatable.__newindex = function (t, key, val) -- This function is called when a module tries to add a new value to the -- args table, or tries to change an existing value. if type(key) == 'string' then key = options.translate[key] end if options.readOnly then error( 'could not write to argument table key "' .. tostring(key) .. '"; the table is read-only', 2 ) elseif options.noOverwrite and args[key] ~= nil then error( 'could not write to argument table key "' .. tostring(key) .. '"; overwriting existing arguments is not permitted', 2 ) elseif val == nil then --[[ -- If the argument is to be overwritten with nil, we need to erase -- the value in metaArgs, so that __index, __pairs and __ipairs do -- not use a previous existing value, if present; and we also need -- to memoize the nil in nilArgs, so that the value isn't looked -- up in the argument tables if it is accessed again. --]] metaArgs[key] = nil nilArgs[key] = 'h' else metaArgs[key] = val end end local function translatenext(invariant) local k, v = next(invariant.t, invariant.k) invariant.k = k if k == nil then return nil elseif type(k) ~= 'string' or not options.backtranslate then return k, v else local backtranslate = options.backtranslate[k] if backtranslate == nil then -- Skip this one. This is a tail call, so this won't cause stack overflow return translatenext(invariant) else return backtranslate, v end end end metatable.__pairs = function () -- Called when pairs is run on the args table. if not metatable.donePairs then mergeArgs(argTables) metatable.donePairs = true end return translatenext, { t = metaArgs } end local function inext(t, i) -- This uses our __index metamethod local v = t[i + 1] if v ~= nil then return i + 1, v end end metatable.__ipairs = function (t) -- Called when ipairs is run on the args table. return inext, t, 0 end return args end return arguments 3134ecce8429b810d445e29eae115e2ae4c36c53 モジュール:IsValidPageName 828 15 42 2016-03-06T17:33:23Z ja>Rxy 0 「[[モジュール:IsValidPageName]]」を保護しました: [[WP:HRT|影響が特に大きいテンプレート]]: 現時点で 44128 ページからの読み込み ([編集=管理者のみに許可] (無期限) [移動=管理者のみに許可] (... Scribunto text/plain -- このモジュールは [[Template:IsValidPageName]] の実体です。 local export = {} function export.isValidPageName(frame) local success, res = pcall(mw.title.new, frame.args[1]) if success and res then return "valid" else return "" end end return export b01c327f3fabc62e4d05a7377fc6d5da2ed5bb28 モジュール:Lua banner 828 42 96 2016-04-18T09:49:32Z ja>にょろん 0 「luaモジュール」と言葉はまだ普及しておらず「使用luaモジュール」では何を言ってるのかわからないので変更しました。使用しているluaモジュールでもいいのですが、luaモジュールを前面 Scribunto text/plain -- {{lua}}というテンプレートで使用されるモジュールです。 local yesno = require('Module:Yesno') local mList = require('Module:List') local mTableTools = require('Module:TableTools') local mMessageBox = require('Module:Message box') local p = {} function p.main(frame) local origArgs = frame:getParent().args local args = {} for k, v in pairs(origArgs) do v = v:match('^%s*(.-)%s*$') if v ~= '' then args[k] = v end end return p._main(args) end function p._main(args) local modules = mTableTools.compressSparseArray(args) local box = p.renderBox(modules) local trackingCategories = p.renderTrackingCategories(args, modules) return box .. trackingCategories end function p.renderBox(modules) local boxArgs = {} if #modules < 1 then boxArgs.text = '<strong class="error">エラー: モジュール名が指定されていません</strong>' else local moduleLinks = {} for i, module in ipairs(modules) do moduleLinks[i] = string.format('[[:%s]]', module) end local moduleList = mList.makeList('bulleted', moduleLinks) boxArgs.text = '[[Wikipedia:Lua|Lua]]モジュールを使用しています:' .. moduleList end boxArgs.type = 'notice' boxArgs.small = true boxArgs.image = '[[File:Lua-logo-nolabel.svg|30px|alt=Lua logo|link=Wikipedia:Lua]]' return mMessageBox.main('mbox', boxArgs) end function p.renderTrackingCategories(args, modules, titleObj) if yesno(args.nocat) then return '' end local cats = {} -- Error category if #modules < 1 then cats[#cats + 1] = '' end -- Lua templates category titleObj = titleObj or mw.title.getCurrentTitle() local subpageBlacklist = { doc = true, sandbox = true, sandbox2 = true, testcases = true } if titleObj.namespace == 10 and not subpageBlacklist[titleObj.subpageText] then local category = args.category if not category then --[[ local categories = { ['Module:String'] = '', ['Module:Math'] = '', ['Module:BaseConvert'] = '', ['Module:Citation'] = '' } categories['Module:Citation/CS1'] = categories['Module:Citation'] category = modules[1] and categories[modules[1]] --]] category = category or 'Luaを利用するテンプレート' end cats[#cats + 1] = category end for i, cat in ipairs(cats) do cats[i] = string.format('[[Category:%s]]', cat) end return table.concat(cats) end return p fe9e40fdfaa53c99094a4c02496eba0231cd1181 モジュール:Infobox/former 828 10 32 2016-09-10T14:57:30Z ja>Waiesu 0 バグ修正; [[Special:Permalink/61098707#バグ修正願い|ノート]], [[Special:Diff/61098937|WP:AN/PE]]による Scribunto text/plain local p = {} function p.main(frame) local args = require('Module:Arguments').getArgs(frame, {parentOnly = true}) --引数取得 local child = (args.child == 'yes') local subbox = (args.subbox == 'yes') local h = {subheader = {}, image = {{}}} --ヘッダー部(subheader, image)テーブル local body, sbody = {}, {} --本体部テーブル, ソート済み本体部テーブル local link = args.tnavbar or args.name --(フッター部)テンプレート名 local result = '' --結果格納用 --[[ subheader, image用引数振り分け ]] local function args2tbl(str, k, v) local num = string.match(k, '%d*$') num = (num == '') and 1 or tonumber(num) h[str][num] = h[str][num] or {} if k == str then h[str][1][1] = v elseif string.match(k, str .. '%d+') then h[str][num][1] = v elseif string.find(k, 'style') then if string.match(k, 'style$') then h[str]['style'] = v else h[str][num]['style'] = v end elseif string.find(k, 'rowclass') then if string.match(k, 'rowclass$') then h[str]['rowclass'] = v else h[str][num]['rowclass'] = v end elseif string.match(k, 'class$') then h[str]['class'] = v end end --[[ 引数振り分け ]] for k, v in pairs(args) do --subheader if string.find(k, 'subheader') then args2tbl('subheader', k, v) --image elseif string.find(k, 'image') then args2tbl('image', k, v) elseif string.find(k, 'caption') then if string.match(k, 'caption$') then h['image'][1]['caption'] = '<div style="' .. (args.captionstyle or '') .. '">' .. v .. '</div>' elseif string.match(k, 'caption%d+') then local num = tonumber(string.match(k, '%d*$')) h['image'][num] = h['image'][num] or {} h['image'][num]['caption'] = '<div style="' .. (args.captionstyle or '') .. '">' .. v .. '</div>' end --その他(本体部) elseif string.match(k, '^%D+%d+$') then local str, num = string.match(k, '^(%D+)(%d+)$') num = tonumber(num) if not body[num] then local OddOrEven = (num % 2 ~= 0) and 'odd' or 'even' body[num] = { num, headerstyle = (args.headerstyle or '') .. (args[OddOrEven .. 'headerstyle'] or ''), labelstyle = (args.labelstyle or '') .. (args[OddOrEven .. 'labelstyle'] or ''), datastyle = (args.datastyle or '') .. (args[OddOrEven .. 'datastyle'] or '') } end body[num][str] = (body[num][str] or '') .. v end end --[[ Template:Infobox/row ]] local function row(header, headerstyle, label, labelstyle, data, datastyle, rowstyle, class, rowclass, id, itemprop, rowitemprop, itemtype, rowitemtype, itemref, rowitemref) local result ='' if header then result = '<tr style="' .. (rowstyle or '') ..'"' .. (rowitemtype and (' itemscope itemtype="' .. rowitemtype .. '"') or '') .. ' itemref="' .. (rowitemref or '') .. '"><th scope="col" colspan="2" class="' .. (class or '') .. '" style="text-align:center; ' .. (headerstyle or '') .. '">' .. header .. '</th></tr>' elseif data then result = '<tr class="' .. (rowclass or '') .. '" style="' .. (rowstyle or '') .. '" itemprop="' .. (rowitemprop or '') .. '"' .. (rowitemtype and (' itemscope itemtype="' .. rowitemtype .. '"') or '') .. ' itemref="' .. (rowitemref or '') .. '">' if label then result = result .. '<th scope="row" style="text-align:left; white-space:nowrap; ' .. (labelstyle or '') .. '">' .. label .. '</th><td class="' .. (class or '') .. '" style="' .. (datastyle or '') .. '" itemprop="' .. (itemprop or '') .. '"' .. (itemtype and (' itemscope itemtype="' .. itemtype .. '"') or '') .. ' itemref="' .. (itemref or '') .. '">' else result = result .. '<td colspan="2" class="' .. (class or '') .. '" style="text-align:center; ' .. (datastyle or '') .. '" itemprop="' .. (itemprop or '') .. '"' .. (itemtype and (' itemscope itemtype="' .. rowitemtype .. '"') or '') .. ' itemref="' .. (itemref or '') .. '">' end result = result .. '\n' .. data .. '</td></tr>' end return result end --[[ Template:Infobox ]] --ヘッダー部 if not child then --tableタグ result = '<table class="' .. (subbox and '' or 'infobox ') .. (args.bodyclass or '') .. '" style="' .. (subbox and 'min-width:100%; width:calc(100% + 6px); margin:-3px; ' or 'width:22em; ') .. (args.bodystyle or '') .. '"' .. (args.bodyitemtype and (' itemscope itemtype="' .. args.bodyitemtype .. '"') or '') .. ' itemref="' .. (args.bodyitemref or '') .. '">' if args.title then --captionタグ result = result .. '<caption itemprop="name" class="' .. (args.titleclass or '') .. '" style="' .. (args.titlestyle or '') .. '">' .. args.title .. '</caption>' end if args.above then result = result .. '<tr><th colspan="2" class="' .. (args.aboveclass or '') .. '" style="text-align:center; font-size:125%; font-weight:bold; ' .. (args.abovestyle or '') .. '" itemprop="' .. (args.aboveitemprop or '') .. '"' .. (args.aboveitemtype and (' itemscope itemtype="' .. args.aboveitemtype .. '"') or '') .. ' itemref="' .. (args.aboveitemref or '') .. '">' .. args.above ..'</th></tr>' end else if args.title then result = '<b itemprop="name' .. '"' .. (args.bodyitemtype and (' itemscope itemtype="' .. args.bodyitemtype .. '"') or '') .. ' itemref="' .. (args.bodyitemref or '') .. '">' .. args.title .. '</b>' end end for k, v in pairs(h.subheader) do result = result .. row(nil, nil, nil, nil, v[1], v.style or h.subheader.style, v.rowstyle, h.subheader.class, v.rowclass, nil, nil, nil, nil, nil, nil, nil) end for k, v in pairs(h.image) do result = result .. row(nil, nil, nil, nil, v[1] and (v[1] .. (v.caption or '')), v.style or h.image.style, v.rowstyle, h.image.class, v.rowclass, nil, nil, nil, nil, nil, nil, nil) end --本体部ソート for k, v in pairs(body) do sbody[#sbody + 1] = v end table.sort(sbody, function (a, b) return a[1] < b[1] end ) --本体部 for k, v in ipairs(sbody) do result = result .. row(v.header, v.headerstyle, v.label, v.labelstyle, v.data, v.datastyle, v.rowstyle, v.class, v.rowclass, v.id, v.itemprop, v.rowitemprop, v.itemtype, v.rowitemtype, v.itemref, v.rowitemref) end --フッター部 if args.below then result = result .. '<tr><td colspan="2" class="' .. (args.belowclass or '') .. '" style="text-align:center; ' .. (args.belowstyle or '') .. '">' .. args.below .. '</td></tr>' end if link then --Template:Transclude link = string.gsub(link, ':?[Tt]emplate:', '') if not string.find(link, ':') then link = 'Template:' .. link end result = result .. '<tr class="noprint"><td colspan=2 style="text-align:right; font-size:85%;">[[' .. link .. '|テンプレートを表示]]</td></tr>' end --tableタグ閉じ if not child then result = result .. '</table>' end --出力 return result end return p e9e52feaf43d7ce5ca20209c5a536f7309cdfdaf テンプレート:Country alias JPN 10 62 136 2017-05-13T13:52:16Z ja>Rxy 0 「[[Template:Country alias JPN]]」の保護レベルを変更しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=管理者のみ許可] (無期限) [移動=管理者のみ許可] (無期限)) wikitext text/x-wiki 日本<noinclude> [[Category:Country aliasテンプレート|JPN]] </noinclude> 10a9563dd41a1f6640b5ca2523adc217081ba85b テンプレート:Country flag alias JPN 10 61 134 2017-05-13T13:52:17Z ja>Rxy 0 「[[Template:Country flag alias JPN]]」の保護レベルを変更しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=管理者のみ許可] (無期限) [移動=管理者のみ許可] (無期限)) wikitext text/x-wiki Flag of Japan.svg<noinclude> [[Category:Country flag aliasテンプレート|JPN]] </noinclude> 477156a85f8456c780ae71ab474d6793b0b6f0d8 モジュール:InfoboxImage 828 59 130 2019-05-11T00:49:28Z ja>ネイ 0 [[:en:Module:InfoboxImage]] oldid=839038061 より更新 Scribunto text/plain -- Inputs: -- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link -- page - page to display for multipage images (DjVu) -- size - size to display the image -- maxsize - maximum size for image -- sizedefault - default size to display the image if size param is blank -- alt - alt text for image -- title - title text for image -- border - set to yes if border -- center - set to yes, if the image has to be centered -- upright - upright image param -- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it -- link - page to visit when clicking on image -- Outputs: -- Formatted image. -- More details available at the "Module:InfoboxImage/doc" page local i = {}; local placeholder_image = { "Blue - Replace this image female.svg", "Blue - Replace this image male.svg", "Female no free image yet.png", "Flag of None (square).svg", "Flag of None.svg", "Flag of.svg", "Green - Replace this image female.svg", "Green - Replace this image male.svg", "Image is needed female.svg", "Image is needed male.svg", "Location map of None.svg", "Male no free image yet.png", "Missing flag.png", "No flag.svg", "No free portrait.svg", "No portrait (female).svg", "No portrait (male).svg", "Red - Replace this image female.svg", "Red - Replace this image male.svg", "Replace this image female (blue).svg", "Replace this image female.svg", "Replace this image male (blue).svg", "Replace this image male.svg", "Silver - Replace this image female.svg", "Silver - Replace this image male.svg", "Replace this image.svg", "Cricket no pic.png", "CarersLogo.gif", "Diagram Needed.svg", "Example.jpg", "Image placeholder.png", "No male portrait.svg", "Nocover-upload.png", "NoDVDcover copy.png", "Noribbon.svg", "No portrait-BFD-test.svg", "Placeholder barnstar ribbon.png", "Project Trains no image.png", "Image-request.png", "Sin bandera.svg", "Sin escudo.svg", "Replace this image - temple.png", "Replace this image butterfly.png", "Replace this image.svg", "Replace this image1.svg", "Resolution angle.png", "Image-No portrait-text-BFD-test.svg", "Insert image here.svg", "No image available.png", "NO IMAGE YET square.png", "NO IMAGE YET.png", "No Photo Available.svg", "No Screenshot.svg", "No-image-available.jpg", "Null.png", "PictureNeeded.gif", "Place holder.jpg", "Unbenannt.JPG", "UploadACopyrightFreeImage.svg", "UploadAnImage.gif", "UploadAnImage.svg", "UploadAnImageShort.svg", "CarersLogo.gif", "Diagram Needed.svg", "No male portrait.svg", "NoDVDcover copy.png", "Placeholder barnstar ribbon.png", "Project Trains no image.png", "Image-request.png", "Noimage.gif", } function i.IsPlaceholder(image) -- change underscores to spaces image = mw.ustring.gsub(image, "_", " "); assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil') -- if image starts with [[ then remove that and anything after | if mw.ustring.sub(image,1,2) == "[[" then image = mw.ustring.sub(image,3); image = mw.ustring.gsub(image, "([^|]*)|.*", "%1"); assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil') end -- Trim spaces image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1'); assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil") -- remove prefix if exists local allNames = mw.site.namespaces[6].aliases allNames[#allNames + 1] = mw.site.namespaces[6].name allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName for i, name in ipairs(allNames) do if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then image = mw.ustring.sub(image, mw.ustring.len(name) + 2); break end end -- Trim spaces image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1'); -- capitalise first letter image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2); for i,j in pairs(placeholder_image) do if image == j then return true end end return false end function i.InfoboxImage(frame) local image = frame.args["image"]; if image == "" or image == nil then return ""; end if image == "&nbsp;" then return image; end if frame.args["suppressplaceholder"] ~= "no" then if i.IsPlaceholder(image) == true then return ""; end end if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then return ""; end if mw.ustring.sub(image,1,2) == "[[" then -- search for thumbnail images and add to tracking cat if found if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then return image .. "[[Category:Infobox内でサムネイル画像を使用しているページ]]"; elseif mw.title.getCurrentTitle().namespace == 0 then return image .. ""; else return image; end elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then return image; elseif mw.ustring.sub(image,1,1) == "<" then return image; elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then -- Found strip marker at begining, so pass don't process at all return image; elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then -- Found strip marker at begining, so pass don't process at all return image; else local result = ""; local page = frame.args["page"]; local size = frame.args["size"]; local maxsize = frame.args["maxsize"]; local sizedefault = frame.args["sizedefault"]; local alt = frame.args["alt"]; local link = frame.args["link"]; local title = frame.args["title"]; local border = frame.args["border"]; local upright = frame.args["upright"] or ""; local thumbtime = frame.args["thumbtime"] or ""; local center= frame.args["center"]; -- remove prefix if exists local allNames = mw.site.namespaces[6].aliases allNames[#allNames + 1] = mw.site.namespaces[6].name allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName for i, name in ipairs(allNames) do if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then image = mw.ustring.sub(image, mw.ustring.len(name) + 2); break end end if maxsize ~= "" and maxsize ~= nil then -- if no sizedefault then set to maxsize if sizedefault == "" or sizedefault == nil then sizedefault = maxsize end -- check to see if size bigger than maxsize if size ~= "" and size ~= nil then local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0; local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0; if sizenumber>maxsizenumber and maxsizenumber>0 then size = maxsize; end end end -- add px to size if just a number if (tonumber(size) or 0) > 0 then size = size .. "px"; end -- add px to sizedefault if just a number if (tonumber(sizedefault) or 0) > 0 then sizedefault = sizedefault .. "px"; end result = "[[File:" .. image; if page ~= "" and page ~= nil then result = result .. "|page=" .. page; end if size ~= "" and size ~= nil then result = result .. "|" .. size; elseif sizedefault ~= "" and sizedefault ~= nil then result = result .. "|" .. sizedefault; else result = result .. "|frameless"; end if center == "yes" then result = result .. "|center" end if alt ~= "" and alt ~= nil then result = result .. "|alt=" .. alt; end if link ~= "" and link ~= nil then result = result .. "|link=" .. link; end if border == "yes" then result = result .. "|border"; end if upright == "yes" then result = result .. "|upright"; elseif upright ~= "" then result = result .. "|upright=" .. upright; end if thumbtime ~= "" then result = result .. "|thumbtime=" .. thumbtime; end if title ~= "" and title ~= nil then result = result .. "|" .. title; elseif alt ~= "" and alt ~= nil then result = result .. "|" .. alt; end result = result .. "]]"; return result; end end return i; 0eb306ccad8c24df8eafc11c761743ced8ec3911 モジュール:See/core 828 21 54 2019-08-25T04:54:27Z ja>ネイ 0 「[[モジュール:See/core]]」を保護しました: [[WP:HRT|影響が特に大きいテンプレート]]: 使用数106,000以上 ([編集=管理者のみ許可] (無期限) [移動=管理者のみ許可] (無期限)) Scribunto text/plain local p = {} function p.GetLink(frame) local link = frame.args[1] local display = frame.args[2] -- 第一引数の値が技術的に利用可能な記事名でない場合、 -- 第一引数の値をそのまま返す local IsValidPageName = require('モジュール:IsValidPageName') if IsValidPageName.isValidPageName(frame) == "" then return link end if display == "" then display = nil end return p._formatLink(link, display) end function p._formatLink(link, display) -- Remove the initial colon for links where it was specified manually. link = link:match('^:?(.*)') -- Find whether a faux display value has been added with the {{!}} magic -- word. if not display then local prePipe, postPipe = link:match('^(.-)|(.*)$') link = prePipe or link display = postPipe end -- Assemble the link. if display then return string.format( '[[:%s|%s]]', string.gsub(link, '|(.*)$', ''), --display overwrites manual piping display ) else return string.format('[[:%s]]', link) end end return p 248d13358e47b444219b6c009d1ae15bb4c41b43 テンプレート:See/core 10 20 52 2019-08-25T04:55:08Z ja>ネイ 0 +{{pp-template}} wikitext text/x-wiki {{#invoke:See/core|GetLink|{{{1}}}|{{{2|}}}}}<noinclude> {{pp-template}} [[Category:内部テンプレート|{{PAGENAME}}]] </noinclude> 6c813fe73a4f973653045e7fa48eca46bcf83999 テンプレート:JPN 10 60 132 2020-01-13T04:37:14Z ja>ネイ 0 「[[Template:JPN]]」の保護レベルを変更しました: [[WP:HRT|影響が特に大きいテンプレート]]: 使用数18万 ([編集=管理者のみ許可] (無期限) [移動=管理者のみ許可] (無期限)) wikitext text/x-wiki {{Flagicon|JPN}} [[日本]]<noinclude> {{Documentation}} </noinclude> 57367ec5ec14e8aded8270eafb313b4075cc25bf テンプレート:Main other 10 48 108 2020-03-28T08:13:34Z ja>ネイ 0 -改行 wikitext text/x-wiki {{#switch: <!--If no or empty "demospace" parameter then detect namespace--> {{#if:{{{demospace|}}} | {{lc: {{{demospace}}} }} <!--Use lower case "demospace"--> | {{#ifeq:{{NAMESPACE}}|{{ns:0}} | main | other }} }} | main = {{{1|}}} | other | #default = {{{2|}}} }}<noinclude> {{Documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> 27fa655c176ab43a6a2b517aba54eab056222601 テンプレート:Flagicon 10 58 128 2020-05-31T15:01:49Z ja>ネイ 0 [[Template:Country alias]]が別物に変わったため修正。ほか-Template sandbox notice wikitext text/x-wiki [[ファイル:{{country flag alias {{{1}}}}}{{#switch:{{{1}}}|NPL=|NEP=|Nepal=|ネパール=|CHN1940=|DEU1945=|JPN1945=|RYU1952=|Ohio=|World=|世界=|#default={{!}}border}}|{{#if:{{{size|}}}|{{{size}}}|25x20px}}|{{{name|{{#if:{{{1|}}}|{{country alias {{{1}}}}}|不明}}の旗}}}{{#if:{{{nolink|}}}|{{!}}link=}}]]<noinclude> {{Documentation}} </noinclude> 3a53bf6821e61393e5c51edb7180a42cb810b267 テンプレート:Tl 10 16 44 2020-08-25T13:25:15Z ja>ネイ 0 [[:en:Template:Tl]] oldid=948474337 より更新 wikitext text/x-wiki &#123;&#123;[[Template:{{{1}}}|{{{1}}}]]&#125;&#125;<noinclude> {{documentation}} <!-- カテゴリと言語間リンクはここではなく、/doc サブページに追加してください --> </noinclude> 4fe179483869fa14fdbfcbafea3a0a99569d80c8 モジュール:Yesno 828 18 48 2020-08-25T13:27:42Z ja>ネイ 0 [[:en:Module:Yesno]] oldid=948473803 より更新 Scribunto text/plain -- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template {{yesno}}. return function (val, default) -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you -- should replace "val:lower()" with "mw.ustring.lower(val)" in the -- following line. val = type(val) == 'string' and val:lower() or val if val == nil then return nil elseif val == true or val == 'yes' or val == 'y' or val == 'true' or val == 't' or val == 'on' or tonumber(val) == 1 then return true elseif val == false or val == 'no' or val == 'n' or val == 'false' or val == 'f' or val == 'off' or tonumber(val) == 0 then return false else return default end end f767643e7d12126d020d88d662a3dd057817b9dc モジュール:TableTools 828 13 38 2020-08-25T13:48:43Z ja>ネイ 0 [[:en:Module:TableTools]] oldid=958399831 より更新 Scribunto text/plain --[[ ------------------------------------------------------------------------------------ -- TableTools -- -- -- -- This module includes a number of functions for dealing with Lua tables. -- -- It is a meta-module, meant to be called from other Lua modules, and should -- -- not be called directly from #invoke. -- ------------------------------------------------------------------------------------ --]] local libraryUtil = require('libraryUtil') local p = {} -- Define often-used variables and functions. local floor = math.floor local infinity = math.huge local checkType = libraryUtil.checkType local checkTypeMulti = libraryUtil.checkTypeMulti --[[ ------------------------------------------------------------------------------------ -- isPositiveInteger -- -- This function returns true if the given value is a positive integer, and false -- if not. Although it doesn't operate on tables, it is included here as it is -- useful for determining whether a given table key is in the array part or the -- hash part of a table. ------------------------------------------------------------------------------------ --]] function p.isPositiveInteger(v) return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity end --[[ ------------------------------------------------------------------------------------ -- isNan -- -- This function returns true if the given number is a NaN value, and false -- if not. Although it doesn't operate on tables, it is included here as it is -- useful for determining whether a value can be a valid table key. Lua will -- generate an error if a NaN is used as a table key. ------------------------------------------------------------------------------------ --]] function p.isNan(v) return type(v) == 'number' and tostring(v) == '-nan' end --[[ ------------------------------------------------------------------------------------ -- shallowClone -- -- This returns a clone of a table. The value returned is a new table, but all -- subtables and functions are shared. Metamethods are respected, but the returned -- table will have no metatable of its own. ------------------------------------------------------------------------------------ --]] function p.shallowClone(t) local ret = {} for k, v in pairs(t) do ret[k] = v end return ret end --[[ ------------------------------------------------------------------------------------ -- removeDuplicates -- -- This removes duplicate values from an array. Non-positive-integer keys are -- ignored. The earliest value is kept, and all subsequent duplicate values are -- removed, but otherwise the array order is unchanged. ------------------------------------------------------------------------------------ --]] function p.removeDuplicates(t) checkType('removeDuplicates', 1, t, 'table') local isNan = p.isNan local ret, exists = {}, {} for i, v in ipairs(t) do if isNan(v) then -- NaNs can't be table keys, and they are also unique, so we don't need to check existence. ret[#ret + 1] = v else if not exists[v] then ret[#ret + 1] = v exists[v] = true end end end return ret end --[[ ------------------------------------------------------------------------------------ -- numKeys -- -- This takes a table and returns an array containing the numbers of any numerical -- keys that have non-nil values, sorted in numerical order. ------------------------------------------------------------------------------------ --]] function p.numKeys(t) checkType('numKeys', 1, t, 'table') local isPositiveInteger = p.isPositiveInteger local nums = {} for k, v in pairs(t) do if isPositiveInteger(k) then nums[#nums + 1] = k end end table.sort(nums) return nums end --[[ ------------------------------------------------------------------------------------ -- affixNums -- -- This takes a table and returns an array containing the numbers of keys with the -- specified prefix and suffix. For example, for the table -- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will -- return {1, 3, 6}. ------------------------------------------------------------------------------------ --]] function p.affixNums(t, prefix, suffix) checkType('affixNums', 1, t, 'table') checkType('affixNums', 2, prefix, 'string', true) checkType('affixNums', 3, suffix, 'string', true) local function cleanPattern(s) -- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally. return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1') end prefix = prefix or '' suffix = suffix or '' prefix = cleanPattern(prefix) suffix = cleanPattern(suffix) local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$' local nums = {} for k, v in pairs(t) do if type(k) == 'string' then local num = mw.ustring.match(k, pattern) if num then nums[#nums + 1] = tonumber(num) end end end table.sort(nums) return nums end --[[ ------------------------------------------------------------------------------------ -- numData -- -- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table -- of subtables in the format -- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} } -- Keys that don't end with an integer are stored in a subtable named "other". -- The compress option compresses the table so that it can be iterated over with -- ipairs. ------------------------------------------------------------------------------------ --]] function p.numData(t, compress) checkType('numData', 1, t, 'table') checkType('numData', 2, compress, 'boolean', true) local ret = {} for k, v in pairs(t) do local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$') if num then num = tonumber(num) local subtable = ret[num] or {} if prefix == '' then -- Positional parameters match the blank string; put them at the start of the subtable instead. prefix = 1 end subtable[prefix] = v ret[num] = subtable else local subtable = ret.other or {} subtable[k] = v ret.other = subtable end end if compress then local other = ret.other ret = p.compressSparseArray(ret) ret.other = other end return ret end --[[ ------------------------------------------------------------------------------------ -- compressSparseArray -- -- This takes an array with one or more nil values, and removes the nil values -- while preserving the order, so that the array can be safely traversed with -- ipairs. ------------------------------------------------------------------------------------ --]] function p.compressSparseArray(t) checkType('compressSparseArray', 1, t, 'table') local ret = {} local nums = p.numKeys(t) for _, num in ipairs(nums) do ret[#ret + 1] = t[num] end return ret end --[[ ------------------------------------------------------------------------------------ -- sparseIpairs -- -- This is an iterator for sparse arrays. It can be used like ipairs, but can -- handle nil values. ------------------------------------------------------------------------------------ --]] function p.sparseIpairs(t) checkType('sparseIpairs', 1, t, 'table') local nums = p.numKeys(t) local i = 0 local lim = #nums return function () i = i + 1 if i <= lim then local key = nums[i] return key, t[key] else return nil, nil end end end --[[ ------------------------------------------------------------------------------------ -- size -- -- This returns the size of a key/value pair table. It will also work on arrays, -- but for arrays it is more efficient to use the # operator. ------------------------------------------------------------------------------------ --]] function p.size(t) checkType('size', 1, t, 'table') local i = 0 for k in pairs(t) do i = i + 1 end return i end local function defaultKeySort(item1, item2) -- "number" < "string", so numbers will be sorted before strings. local type1, type2 = type(item1), type(item2) if type1 ~= type2 then return type1 < type2 else -- This will fail with table, boolean, function. return item1 < item2 end end --[[ Returns a list of the keys in a table, sorted using either a default comparison function or a custom keySort function. ]] function p.keysToList(t, keySort, checked) if not checked then checkType('keysToList', 1, t, 'table') checkTypeMulti('keysToList', 2, keySort, { 'function', 'boolean', 'nil' }) end local list = {} local index = 1 for key, value in pairs(t) do list[index] = key index = index + 1 end if keySort ~= false then keySort = type(keySort) == 'function' and keySort or defaultKeySort table.sort(list, keySort) end return list end --[[ Iterates through a table, with the keys sorted using the keysToList function. If there are only numerical keys, sparseIpairs is probably more efficient. ]] function p.sortedPairs(t, keySort) checkType('sortedPairs', 1, t, 'table') checkType('sortedPairs', 2, keySort, 'function', true) local list = p.keysToList(t, keySort, true) local i = 0 return function() i = i + 1 local key = list[i] if key ~= nil then return key, t[key] else return nil, nil end end end --[[ Returns true if all keys in the table are consecutive integers starting at 1. --]] function p.isArray(t) checkType("isArray", 1, t, "table") local i = 0 for k, v in pairs(t) do i = i + 1 if t[i] == nil then return false end end return true end -- { "a", "b", "c" } -> { a = 1, b = 2, c = 3 } function p.invert(array) checkType("invert", 1, array, "table") local map = {} for i, v in ipairs(array) do map[v] = i end return map end --[[ { "a", "b", "c" } -> { ["a"] = true, ["b"] = true, ["c"] = true } --]] function p.listToSet(t) checkType("listToSet", 1, t, "table") local set = {} for _, item in ipairs(t) do set[item] = true end return set end --[[ Recursive deep copy function. Preserves identities of subtables. ]] local function _deepCopy(orig, includeMetatable, already_seen) -- Stores copies of tables indexed by the original table. already_seen = already_seen or {} local copy = already_seen[orig] if copy ~= nil then return copy end if type(orig) == 'table' then copy = {} for orig_key, orig_value in pairs(orig) do copy[deepcopy(orig_key, includeMetatable, already_seen)] = deepcopy(orig_value, includeMetatable, already_seen) end already_seen[orig] = copy if includeMetatable then local mt = getmetatable(orig) if mt ~= nil then local mt_copy = deepcopy(mt, includeMetatable, already_seen) setmetatable(copy, mt_copy) already_seen[mt] = mt_copy end end else -- number, string, boolean, etc copy = orig end return copy end function p.deepCopy(orig, noMetatable, already_seen) checkType("deepCopy", 3, already_seen, "table", true) return _deepCopy(orig, not noMetatable, already_seen) end --[[ Concatenates all values in the table that are indexed by a number, in order. sparseConcat{ a, nil, c, d } => "acd" sparseConcat{ nil, b, c, d } => "bcd" ]] function p.sparseConcat(t, sep, i, j) local list = {} local list_i = 0 for _, v in p.sparseIpairs(t) do list_i = list_i + 1 list[list_i] = v end return table.concat(list, sep, i, j) end --[[ -- Finds the length of an array, or of a quasi-array with keys such -- as "data1", "data2", etc., using an exponential search algorithm. -- It is similar to the operator #, but may return -- a different value when there are gaps in the array portion of the table. -- Intended to be used on data loaded with mw.loadData. For other tables, use #. -- Note: #frame.args in frame object always be set to 0, regardless of -- the number of unnamed template parameters, so use this function for -- frame.args. --]] function p.length(t, prefix) -- requiring module inline so that [[Module:Exponential search]] -- which is only needed by this one function -- doesn't get millions of transclusions local expSearch = require("Module:Exponential search") checkType('length', 1, t, 'table') checkType('length', 2, prefix, 'string', true) return expSearch(function(i) local key if prefix then key = prefix .. tostring(i) else key = i end return t[key] ~= nil end) or 0 end function p.inArray(arr, valueToFind) checkType("inArray", 1, arr, "table") -- if valueToFind is nil, error? for _, v in ipairs(arr) do if v == valueToFind then return true end end return false end return p ad3062fee63cdfb979a1543abf96236cf7bf609d テンプレート:Collapse top 10 52 116 2021-02-14T01:31:53Z ja>K-iczn 0 [[en:Template:Collapse top]] 2021年1月16日 (土) 00:39(UTC)より wikitext text/x-wiki <div style="margin-left:{{{indent|0}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section --> {| <!-- Template:Collapse top --> class="mw-collapsible {{<includeonly>safesubst:</includeonly>#if:{{{expand|{{{collapse|}}}}}}||mw-collapsed}} {{{class|}}}" style="background: {{{bg1|transparent}}}; text-align: left; border: {{{border|1px}}} solid {{{b-color|Silver}}}; margin: 0.2em auto auto; width:{{<includeonly>safesubst:</includeonly>#if:{{{width|}}}|{{{width}}}|100%}}; clear: {{{clear|both}}}; padding: 1px;" |- ! style="background: {{{bg|#{{main other|F0F2F5|CCFFCC}}}}}; font-size:87%; padding:0.2em 0.3em; text-align:{{<includeonly>safesubst:</includeonly>#if:{{{left|}}}|left|{{<includeonly>safesubst:</includeonly>#if:{{{align|}}}|left|center}}}}; {{<includeonly>safesubst:</includeonly>#if:{{{fc|}}}|color: {{{fc}}};|}}" | <div style="display:inline;font-size:115%">{{{1|{{{title|{{{reason|{{{header|{{{heading|{{{result|Extended content}}}}}}}}}}}}}}}}}}</div> {{<includeonly>safesubst:</includeonly>#if:{{{warning|{{{2|}}}}}} |{{<includeonly>safesubst:</includeonly>!}}- {{<includeonly>safesubst:</includeonly>!}} style="text-align:center; font-style:italic;" {{<includeonly>safesubst:</includeonly>!}} {{{2|The following is a closed discussion. {{strongbad|Please do not modify it.}} }}} }} |- | style="border: solid {{{border2|1px Silver}}}; padding: {{{padding|0.6em}}}; background: {{{bg2|White}}};" {{<includeonly>safesubst:</includeonly>!}}<noinclude> {{lorem ipsum|3}} {{Collapse bottom}} {{Documentation}} </noinclude> 83a71e0b3d311baf7affdd76cc0731a2554c62f3 テンプレート:Pp-template 10 50 112 2021-04-06T05:42:02Z ja>えのきだたもつ 0 「[[Template:Pp-template]]」を保護しました: [[Wikipedia:保護依頼]]による: [[Wikipedia:保護の方針#半永久的な保護]]「[[Wikipedia:影響が特に大きいテンプレート|影響が特に大きいテンプレート]]」 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki <includeonly>{{#invoke:Protection banner|main}}</includeonly><noinclude> {{Documentation}} </noinclude> 06392f515310490bd271ac55741f5dd1f0975304 テンプレート:Rellink 10 28 68 2021-04-09T09:36:10Z ja>えのきだたもつ 0 「[[Template:Rellink]]」の保護レベルを変更しました: [[Wikipedia:保護依頼]]による: [[Wikipedia:保護の方針#半永久的な保護]]「[[Wikipedia:影響が特に大きいテンプレート|影響が特に大きいテンプレート]]」 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki <div class="rellink {{{extraclasses|}}}" style="margin-bottom: 0.5em; padding-left: 2em; font-style: italic;">{{{1}}}</div><noinclude> {{documentation}} </noinclude> bfed577a8fc6f9d931dd67a7dc16a3a9c940a514 テンプレート:Yesno 10 63 138 2021-04-23T04:39:51Z ja>ネイ 0 -コメント wikitext text/x-wiki {{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }} |no |n |false |0 = {{{no|}}} | = {{{blank|{{{no|}}}}}} |¬ = {{{¬|}}} |yes |y |true |1 = {{{yes|yes}}} |#default = {{{def|{{{yes|yes}}}}}} }}<noinclude> {{Documentation}} </noinclude> a06c5c6c22e3af653eec98c1f974c753e40e73d0 テンプレート:Main 10 36 84 2021-05-21T18:43:04Z ja>えのきだたもつ 0 「[[Template:Main]]」の保護レベルを変更しました: [[Wikipedia:保護の方針#半永久的な保護]]「[[Wikipedia:影響が特に大きいテンプレート|影響が特に大きいテンプレート]]」に基づき無期限拡張半保護 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki {{rellink|1 = 詳細は{{#if:{{{1<includeonly>|</includeonly>}}}|「{{see/core|{{{1}}}|{{{l1|{{{1}}}}}}}}」 | 「{{error|エラー:記事名が入力されていません}}」 }}{{#if:{{{2|}}}|{{#if:{{{3|}}}|、|および}}「{{see/core|{{{2}}}|{{{l2|{{{2}}}}}}}}」 }}{{#if:{{{3|}}}|{{#if:{{{4|}}}|、|、および}}「{{see/core|{{{3}}}|{{{l3|{{{3}}}}}}}}」 }}{{#if:{{{4|}}}|{{#if:{{{5|}}}|、|、および}}「{{see/core|{{{4}}}|{{{l4|{{{4}}}}}}}}」 }}{{#if:{{{5|}}}|{{#if:{{{6|}}}|、|、および}}「{{see/core|{{{5}}}|{{{l5|{{{5}}}}}}}}」 }}{{#if:{{{6|}}}|{{#if:{{{7|}}}|、|、および}}「{{see/core|{{{6}}}|{{{l6|{{{6}}}}}}}}」 }}{{#if:{{{7|}}}|{{#if:{{{8|}}}|、|、および}}「{{see/core|{{{7}}}|{{{l7|{{{7}}}}}}}}」 }}{{#if:{{{8|}}}|{{#if:{{{9|}}}|、|、および}}「{{see/core|{{{8}}}|{{{l8|{{{8}}}}}}}}」 }}{{#if:{{{9|}}}|{{#if:{{{10|}}}|、|、および}}「{{see/core|{{{9}}}|{{{l9|{{{9}}}}}}}}」 }}{{#if:{{{10|}}}|{{#if:{{{11|}}}|、|、および}}「{{see/core|{{{10}}}|{{{l10|{{{10}}}}}}}}」 }}{{#if:{{{11|}}}|{{#if:{{{12|}}}|、|、および}}「{{see/core|{{{11}}}|{{{l11|{{{11}}}}}}}}」 }}{{#if:{{{12|}}}|{{#if:{{{13|}}}|、|、および}}「{{see/core|{{{12}}}|{{{l12|{{{12}}}}}}}}」 }}{{#if:{{{13|}}}|{{#if:{{{14|}}}|、|、および}}「{{see/core|{{{13}}}|{{{l13|{{{13}}}}}}}}」 }}{{#if:{{{14|}}}|{{#if:{{{15|}}}|、|、および}}「{{see/core|{{{14}}}|{{{l14|{{{14}}}}}}}}」 }}{{#if:{{{15|}}}|、および「{{see/core|{{{15}}}|{{{l15|{{{15}}}}}}}}」 }}{{#if:{{{16|}}}|…{{error|最大15記事までです。}} }}を参照}}<noinclude> {{Documentation}} </noinclude> db94b24594039a380fed8cbcaba6af6e742a162c テンプレート:See also 10 64 140 2021-05-21T18:43:29Z ja>えのきだたもつ 0 「[[Template:See also]]」の保護レベルを変更しました: [[Wikipedia:保護の方針#半永久的な保護]]「[[Wikipedia:影響が特に大きいテンプレート|影響が特に大きいテンプレート]]」に基づき無期限拡張半保護 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki <includeonly>{{rellink|1 = {{#if:{{{1|}}}|「{{see/core|{{{1}}}|{{{l1|{{{1}}}}}}}}」 | 「{{error|エラー:記事名が入力されていません}}」 }}{{#if:{{{2|}}}|{{#if:{{{3|}}}|、|および}}「{{see/core|{{{2}}}|{{{l2|{{{2}}}}}}}}」 }}{{#if:{{{3|}}}|{{#if:{{{4|}}}|、|、および}}「{{see/core|{{{3}}}|{{{l3|{{{3}}}}}}}}」 }}{{#if:{{{4|}}}|{{#if:{{{5|}}}|、|、および}}「{{see/core|{{{4}}}|{{{l4|{{{4}}}}}}}}」 }}{{#if:{{{5|}}}|{{#if:{{{6|}}}|、|、および}}「{{see/core|{{{5}}}|{{{l5|{{{5}}}}}}}}」 }}{{#if:{{{6|}}}|{{#if:{{{7|}}}|、|、および}}「{{see/core|{{{6}}}|{{{l6|{{{6}}}}}}}}」 }}{{#if:{{{7|}}}|{{#if:{{{8|}}}|、|、および}}「{{see/core|{{{7}}}|{{{l7|{{{7}}}}}}}}」 }}{{#if:{{{8|}}}|{{#if:{{{9|}}}|、|、および}}「{{see/core|{{{8}}}|{{{l8|{{{8}}}}}}}}」 }}{{#if:{{{9|}}}|{{#if:{{{10|}}}|、|、および}}「{{see/core|{{{9}}}|{{{l9|{{{9}}}}}}}}」 }}{{#if:{{{10|}}}|{{#if:{{{11|}}}|、|、および}}「{{see/core|{{{10}}}|{{{l10|{{{10}}}}}}}}」 }}{{#if:{{{11|}}}|{{#if:{{{12|}}}|、|、および}}「{{see/core|{{{11}}}|{{{l11|{{{11}}}}}}}}」 }}{{#if:{{{12|}}}|{{#if:{{{13|}}}|、|、および}}「{{see/core|{{{12}}}|{{{l12|{{{12}}}}}}}}」 }}{{#if:{{{13|}}}|{{#if:{{{14|}}}|、|、および}}「{{see/core|{{{13}}}|{{{l13|{{{13}}}}}}}}」 }}{{#if:{{{14|}}}|{{#if:{{{15|}}}|、|、および}}「{{see/core|{{{14}}}|{{{l14|{{{14}}}}}}}}」 }}{{#if:{{{15|}}}|、および「{{see/core|{{{15}}}|{{{l15|{{{15}}}}}}}}」 }}{{#if:{{{16|}}}|…{{error|最大15記事までです。}} }}も参照}}</includeonly><noinclude> {{Documentation}}</noinclude> d7d094c7b5239ef92bfdc9ab69b283faaabf21ec テンプレート:Ombox 10 29 70 2021-05-21T18:43:49Z ja>えのきだたもつ 0 「[[Template:Ombox]]」の保護レベルを変更しました: [[Wikipedia:保護の方針#半永久的な保護]]「[[Wikipedia:影響が特に大きいテンプレート|影響が特に大きいテンプレート]]」に基づき無期限拡張半保護 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki {{#invoke:Message box|ombox}}<noinclude> {{documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> c5769da6f1f152b10c526fbcbf3941106a0b552b テンプレート:MONTHNAME 10 57 126 2021-05-21T18:53:46Z ja>えのきだたもつ 0 「[[Template:MONTHNAME]]」を保護しました: [[Wikipedia:保護の方針#半永久的な保護]]「[[Wikipedia:影響が特に大きいテンプレート|影響が特に大きいテンプレート]]」に基づき無期限拡張半保護 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki <includeonly><!-- -->{{#switch: |{{{1|}}} = Missing required parameter 1=''month''! |{{#ifexpr:({{{1}}})<13 and abs{{{1}}}=trunc{{{1}}} and {{{1}}}||false}}={{#expr:{{{1}}} }}月 }}</includeonly><noinclude> {{Documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> c95afba518236d12b2a3964825dccfb9d7e63892 モジュール:Documentation/styles.css 828 35 82 2021-05-21T18:53:53Z ja>えのきだたもつ 0 「[[モジュール:Documentation/styles.css]]」の保護レベルを変更しました: [[Wikipedia:保護の方針#半永久的な保護]]「[[Wikipedia:影響が特に大きいテンプレート|影響が特に大きいテンプレート]]」に基づき無期限拡張半保護 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) text text/plain /* {{pp-template}} */ .documentation, .documentation-metadata { border: 1px solid #a2a9b1; background-color: #ecfcf4; clear: both; } .documentation { margin: 1em 0 0 0; padding: 1em; } .documentation-metadata { margin: 0.2em 0; /* same margin left-right as .documentation */ font-style: italic; padding: 0.4em 1em; /* same padding left-right as .documentation */ } .documentation-startbox { padding-bottom: 3px; border-bottom: 1px solid #aaa; margin-bottom: 1ex; } .documentation-heading { font-weight: bold; font-size: 125%; } .documentation-clear { /* Don't want things to stick out where they shouldn't. */ clear: both; } .documentation-toolbar { font-style: normal; font-size: 85%; } /* [[カテゴリ:テンプレートスタイル]] */ fea08746bcb1ff7d911742aad831da11f8e886da モジュール:Documentation/config 828 34 80 2021-05-21T18:53:54Z ja>えのきだたもつ 0 「[[モジュール:Documentation/config]]」の保護レベルを変更しました: [[Wikipedia:保護の方針#半永久的な保護]]「[[Wikipedia:影響が特に大きいテンプレート|影響が特に大きいテンプレート]]」に基づき無期限拡張半保護 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) Scribunto text/plain ---------------------------------------------------------------------------------------------------- -- -- Configuration for Module:Documentation -- -- Here you can set the values of the parameters and messages used in Module:Documentation to -- localise it to your wiki and your language. Unless specified otherwise, values given here -- should be string values. ---------------------------------------------------------------------------------------------------- local cfg = {} -- Do not edit this line. ---------------------------------------------------------------------------------------------------- -- Protection template configuration ---------------------------------------------------------------------------------------------------- -- cfg['protection-reason-edit'] -- The protection reason for edit-protected templates to pass to -- [[Module:Protection banner]]. cfg['protection-reason-edit'] = 'template' --[[ ---------------------------------------------------------------------------------------------------- -- Sandbox notice configuration -- -- On sandbox pages the module can display a template notifying users that the current page is a -- sandbox, and the location of test cases pages, etc. The module decides whether the page is a -- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the -- messages that the notices contains. ---------------------------------------------------------------------------------------------------- --]] -- cfg['sandbox-notice-image'] -- The image displayed in the sandbox notice. cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]' --[[ -- cfg['sandbox-notice-pagetype-template'] -- cfg['sandbox-notice-pagetype-module'] -- cfg['sandbox-notice-pagetype-other'] -- The page type of the sandbox page. The message that is displayed depends on the current subject -- namespace. This message is used in either cfg['sandbox-notice-blurb'] or -- cfg['sandbox-notice-diff-blurb']. --]] cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:テンプレートのサンドボックスとテストケース|テンプレート・サンドボックス]]ページ' cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:テンプレートのサンドボックスとテストケース|モジュール・サンドボックス]]ページ' cfg['sandbox-notice-pagetype-other'] = 'サンドボックス・ページ' --[[ -- cfg['sandbox-notice-blurb'] -- cfg['sandbox-notice-diff-blurb'] -- cfg['sandbox-notice-diff-display'] -- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence -- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page -- type, which is either cfg['sandbox-notice-pagetype-template'], -- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what -- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between -- the sandbox and the main template. The display value of the diff link is set by -- cfg['sandbox-notice-compare-link-display']. --]] cfg['sandbox-notice-blurb'] = 'これは$2の$1です。' cfg['sandbox-notice-diff-blurb'] = 'これは$2 ($3)の$1です。' cfg['sandbox-notice-compare-link-display'] = '差分' --[[ -- cfg['sandbox-notice-testcases-blurb'] -- cfg['sandbox-notice-testcases-link-display'] -- cfg['sandbox-notice-testcases-run-blurb'] -- cfg['sandbox-notice-testcases-run-link-display'] -- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page -- corresponding to this sandbox that they can edit. $1 is a link to the test cases page. -- cfg['sandbox-notice-testcases-link-display'] is the display value for that link. -- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page -- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test -- cases page, and $2 is a link to the page to run it. -- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test -- cases. --]] cfg['sandbox-notice-testcases-blurb'] = '対応する$1・サブページもご確認ください。' cfg['sandbox-notice-testcases-link-display'] = 'テストケース' cfg['sandbox-notice-testcases-run-blurb'] = '対応する$1・サブページ ($2) もご確認ください。' cfg['sandbox-notice-testcases-run-link-display'] = '実行' -- cfg['sandbox-category'] -- A category to add to all template sandboxes. cfg['sandbox-category'] = 'テンプレート・サンドボックス' ---------------------------------------------------------------------------------------------------- -- Start box configuration ---------------------------------------------------------------------------------------------------- -- cfg['documentation-icon-wikitext'] -- The wikitext for the icon shown at the top of the template. cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]' -- cfg['template-namespace-heading'] -- The heading shown in the template namespace. cfg['template-namespace-heading'] = 'テンプレートの解説' -- cfg['module-namespace-heading'] -- The heading shown in the module namespace. cfg['module-namespace-heading'] = 'モジュールの解説' -- cfg['file-namespace-heading'] -- The heading shown in the file namespace. cfg['file-namespace-heading'] = '要約' -- cfg['other-namespaces-heading'] -- The heading shown in other namespaces. cfg['other-namespaces-heading'] = '解説' -- cfg['view-link-display'] -- The text to display for "view" links. cfg['view-link-display'] = '表示' -- cfg['edit-link-display'] -- The text to display for "edit" links. cfg['edit-link-display'] = '編集' -- cfg['history-link-display'] -- The text to display for "history" links. cfg['history-link-display'] = '履歴' -- cfg['purge-link-display'] -- The text to display for "purge" links. cfg['purge-link-display'] = 'キャッシュを破棄' -- cfg['create-link-display'] -- The text to display for "create" links. cfg['create-link-display'] = '作成' ---------------------------------------------------------------------------------------------------- -- Link box (end box) configuration ---------------------------------------------------------------------------------------------------- -- cfg['transcluded-from-blurb'] -- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page. cfg['transcluded-from-blurb'] = 'この[[Help:テンプレートの説明文|解説]]は、$1から[[Help:テンプレート#テンプレートとは|呼び出されて]]います。' --[[ -- cfg['create-module-doc-blurb'] -- Notice displayed in the module namespace when the documentation subpage does not exist. -- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the -- display cfg['create-link-display']. --]] cfg['create-module-doc-blurb'] = 'この[[Wikipedia:Lua|Scribuntoモジュール]]の解説ページを$1することができます。' ---------------------------------------------------------------------------------------------------- -- Experiment blurb configuration ---------------------------------------------------------------------------------------------------- --[[ -- cfg['experiment-blurb-template'] -- cfg['experiment-blurb-module'] -- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages. -- It is only shown in the template and module namespaces. With the default English settings, it -- might look like this: -- -- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. -- -- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links. -- -- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending -- on what namespace we are in. -- -- Parameters: -- -- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format: -- -- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display']) -- -- If the sandbox doesn't exist, it is in the format: -- -- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display']) -- -- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload'] -- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display'] -- loads a default edit summary of cfg['mirror-edit-summary']. -- -- $2 is a link to the test cases page. If the test cases page exists, it is in the following format: -- -- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display']) -- -- If the test cases page doesn't exist, it is in the format: -- -- cfg['testcases-link-display'] (cfg['testcases-create-link-display']) -- -- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the -- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current -- namespace. --]] cfg['experiment-blurb-template'] = "編集者は、このテンプレートを$1と$2で試すことができます。([[Wikipedia:テンプレートのサンドボックスとテストケース|解説]])" cfg['experiment-blurb-module'] = "編集者は、このモジュールを$1と$2で試すことができます。([[Wikipedia:テンプレートのサンドボックスとテストケース|解説]])" ---------------------------------------------------------------------------------------------------- -- Sandbox link configuration ---------------------------------------------------------------------------------------------------- -- cfg['sandbox-subpage'] -- The name of the template subpage typically used for sandboxes. cfg['sandbox-subpage'] = 'sandbox' -- cfg['template-sandbox-preload'] -- Preload file for template sandbox pages. cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox' -- cfg['module-sandbox-preload'] -- Preload file for Lua module sandbox pages. cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox' -- cfg['sandbox-link-display'] -- The text to display for "sandbox" links. cfg['sandbox-link-display'] = 'サンドボックス' -- cfg['sandbox-edit-link-display'] -- The text to display for sandbox "edit" links. cfg['sandbox-edit-link-display'] = '編集' -- cfg['sandbox-create-link-display'] -- The text to display for sandbox "create" links. cfg['sandbox-create-link-display'] = '作成' -- cfg['compare-link-display'] -- The text to display for "compare" links. cfg['compare-link-display'] = '差分' -- cfg['mirror-edit-summary'] -- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the -- template page. cfg['mirror-edit-summary'] = '$1のサンドボックスバージョンを作成' -- cfg['mirror-link-display'] -- The text to display for "mirror" links. cfg['mirror-link-display'] = '複製' -- cfg['mirror-link-preload'] -- The page to preload when a user clicks the "mirror" link. cfg['mirror-link-preload'] = 'Template:Documentation/mirror' ---------------------------------------------------------------------------------------------------- -- Test cases link configuration ---------------------------------------------------------------------------------------------------- -- cfg['testcases-subpage'] -- The name of the template subpage typically used for test cases. cfg['testcases-subpage'] = 'testcases' -- cfg['template-testcases-preload'] -- Preload file for template test cases pages. cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases' -- cfg['module-testcases-preload'] -- Preload file for Lua module test cases pages. cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases' -- cfg['testcases-link-display'] -- The text to display for "testcases" links. cfg['testcases-link-display'] = 'テストケース' -- cfg['testcases-edit-link-display'] -- The text to display for test cases "edit" links. cfg['testcases-edit-link-display'] = '編集' -- cfg['testcases-run-link-display'] -- The text to display for test cases "run" links. cfg['testcases-run-link-display'] = '作動' -- cfg['testcases-create-link-display'] -- The text to display for test cases "create" links. cfg['testcases-create-link-display'] = '作成' ---------------------------------------------------------------------------------------------------- -- Add categories blurb configuration ---------------------------------------------------------------------------------------------------- --[[ -- cfg['add-categories-blurb'] -- Text to direct users to add categories to the /doc subpage. Not used if the "content" or -- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a -- link to the /doc subpage with a display value of cfg['doc-link-display']. --]] cfg['add-categories-blurb'] = '$1のサブページにカテゴリを追加してください。' -- cfg['doc-link-display'] -- The text to display when linking to the /doc subpage. cfg['doc-link-display'] = '/doc' ---------------------------------------------------------------------------------------------------- -- Subpages link configuration ---------------------------------------------------------------------------------------------------- --[[ -- cfg['subpages-blurb'] -- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a -- display value of cfg['subpages-link-display']. In the English version this blurb is simply -- the link followed by a period, and the link display provides the actual text. --]] cfg['subpages-blurb'] = '$1' --[[ -- cfg['subpages-link-display'] -- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'], -- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in -- the template namespace, the module namespace, or another namespace. --]] cfg['subpages-link-display'] = 'この$1のサブページ一覧。' -- cfg['template-pagetype'] -- The pagetype to display for template pages. cfg['template-pagetype'] = 'テンプレート' -- cfg['module-pagetype'] -- The pagetype to display for Lua module pages. cfg['module-pagetype'] = 'モジュール' -- cfg['default-pagetype'] -- The pagetype to display for pages other than templates or Lua modules. cfg['default-pagetype'] = 'ページ' ---------------------------------------------------------------------------------------------------- -- Doc link configuration ---------------------------------------------------------------------------------------------------- -- cfg['doc-subpage'] -- The name of the subpage typically used for documentation pages. cfg['doc-subpage'] = 'doc' -- cfg['file-docpage-preload'] -- Preload file for documentation page in the file namespace. cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace' -- cfg['docpage-preload'] -- Preload file for template documentation pages in all namespaces. cfg['docpage-preload'] = 'Template:Documentation/preload' -- cfg['module-preload'] -- Preload file for Lua module documentation pages. cfg['module-preload'] = 'Template:Documentation/preload-module-doc' ---------------------------------------------------------------------------------------------------- -- Print version configuration ---------------------------------------------------------------------------------------------------- -- cfg['print-subpage'] -- The name of the template subpage used for print versions. cfg['print-subpage'] = 'Print' -- cfg['print-link-display'] -- The text to display when linking to the /Print subpage. cfg['print-link-display'] = '/Print' -- cfg['print-blurb'] -- Text to display if a /Print subpage exists. $1 is a link to the subpage with -- a display value of cfg['print-link-display']. cfg['print-blurb'] = '$1にこのテンプレートは[[:en:Help:Books/for experts#Improving the book layout|印刷用バージョンがあります]]。' .. 'もしこのテンプレートを更新した時は、印刷用バージョンも更新してください。' -- cfg['display-print-category'] -- Set to true to enable output of cfg['print-category'] if a /Print subpage exists. -- This should be a boolean value (either true or false). cfg['display-print-category'] = true -- cfg['print-category'] -- Category to output if cfg['display-print-category'] is set to true, and a /Print subpage exists. cfg['print-category'] = '' ---------------------------------------------------------------------------------------------------- -- HTML and CSS configuration ---------------------------------------------------------------------------------------------------- -- cfg['templatestyles'] -- The name of the TemplateStyles page where CSS is kept. -- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed. cfg['templatestyles'] = 'Module:Documentation/styles.css' -- cfg['container'] -- Class which can be used to set flex or grid CSS on the -- two child divs documentation and documentation-metadata cfg['container'] = 'documentation-container' -- cfg['main-div-classes'] -- Classes added to the main HTML "div" tag. cfg['main-div-classes'] = 'documentation' -- cfg['main-div-heading-class'] -- Class for the main heading for templates and modules and assoc. talk spaces cfg['main-div-heading-class'] = 'documentation-heading' -- cfg['start-box-class'] -- Class for the start box cfg['start-box-class'] = 'documentation-startbox' -- cfg['start-box-link-classes'] -- Classes used for the [view][edit][history] or [create] links in the start box. -- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]] cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks' -- cfg['end-box-class'] -- Class for the end box. cfg['end-box-class'] = 'documentation-metadata' -- cfg['end-box-plainlinks'] -- Plainlinks cfg['end-box-plainlinks'] = 'plainlinks' -- cfg['toolbar-class'] -- Class added for toolbar links. cfg['toolbar-class'] = 'documentation-toolbar' -- cfg['clear'] -- Just used to clear things. cfg['clear'] = 'documentation-clear' ---------------------------------------------------------------------------------------------------- -- Tracking category configuration ---------------------------------------------------------------------------------------------------- -- cfg['display-strange-usage-category'] -- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage -- or a /testcases subpage. This should be a boolean value (either true or false). cfg['display-strange-usage-category'] = true -- cfg['strange-usage-category'] -- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a -- /doc subpage or a /testcases subpage. cfg['strange-usage-category'] = '((documentation))の異常な使用があるページ' --[[ ---------------------------------------------------------------------------------------------------- -- End configuration -- -- Don't edit anything below this line. ---------------------------------------------------------------------------------------------------- --]] return cfg 3093010f18cd91593aecbda3f2cd842d19db7204 テンプレート:Documentation 10 32 76 2021-05-21T18:54:03Z ja>えのきだたもつ 0 「[[Template:Documentation]]」の保護レベルを変更しました: [[Wikipedia:保護の方針#半永久的な保護]]「[[Wikipedia:影響が特に大きいテンプレート|影響が特に大きいテンプレート]]」に基づき無期限拡張半保護 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki {{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude> <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> 913c721b3fb5da9e7d6bc410eb2ce87c99df6b03 モジュール:Color contrast/colors 828 67 146 2021-05-21T19:05:05Z ja>えのきだたもつ 0 「[[モジュール:Color contrast/colors]]」を保護しました: [[Wikipedia:保護の方針#半永久的な保護]]「[[Wikipedia:影響が特に大きいテンプレート|影響が特に大きいテンプレート]]」に基づき無期限拡張半保護 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) Scribunto text/plain return { aliceblue = 0.92880068253475, antiquewhite = 0.84646951707754, aqua = 0.7874, aquamarine = 0.8078549208338, azure = 0.97265264954166, beige = 0.8988459998705, bisque = 0.80732327372979, black = 0, blanchedalmond = 0.85084439608156, blue = 0.0722, blueviolet = 0.12622014321946, brown = 0.098224287876511, burlywood = 0.51559844533893, cadetblue = 0.29424681085422, chartreuse = 0.76032025902623, chocolate = 0.23898526114557, coral = 0.37017930872924, cornflowerblue = 0.30318641994179, cornsilk = 0.93562110372965, crimson = 0.16042199953026, cyan = 0.7874, darkblue = 0.018640801980939, darkcyan = 0.20329317839046, darkgoldenrod = 0.27264703559993, darkgray = 0.39675523072563, darkgreen = 0.091143429047575, darkgrey = 0.39675523072563, darkkhaki = 0.45747326349994, darkmagenta = 0.07353047651207, darkolivegreen = 0.12651920884889, darkorange = 0.40016167026524, darkorchid = 0.13413142174857, darkred = 0.054889674531132, darksalmon = 0.40541471563381, darkseagreen = 0.43789249325969, darkslateblue = 0.065792846227988, darkslategray = 0.067608151928044, darkslategrey = 0.067608151928044, darkturquoise = 0.4874606277449, darkviolet = 0.10999048339343, deeppink = 0.23866895828276, deepskyblue = 0.44481603395575, dimgray = 0.14126329114027, dimgrey = 0.14126329114027, dodgerblue = 0.27442536991456, firebrick = 0.10724525535015, floralwhite = 0.95922484825004, forestgreen = 0.18920812076002, fuchsia = 0.2848, gainsboro = 0.71569350050648, ghostwhite = 0.94311261886323, gold = 0.69860877428159, goldenrod = 0.41919977809569, gray = 0.2158605001139, green = 0.15438342968146, greenyellow = 0.80609472611453, grey = 0.2158605001139, honeydew = 0.96336535554782, hotpink = 0.34658438169715, indianred = 0.21406134963884, indigo = 0.03107561486337, ivory = 0.99071270600615, khaki = 0.77012343394121, lavender = 0.80318750514521, lavenderblush = 0.90172748631046, lawngreen = 0.73905893124963, lemonchiffon = 0.94038992245622, lightblue = 0.63709141280807, lightcoral = 0.35522120733135, lightcyan = 0.94587293494829, lightgoldenrodyellow = 0.93348351018297, lightgray = 0.65140563741982, lightgreen = 0.69091979956865, lightgrey = 0.65140563741982, lightpink = 0.58566152734898, lightsalmon = 0.4780675225206, lightseagreen = 0.35050145117042, lightskyblue = 0.56195637618331, lightslategray = 0.23830165007287, lightslategrey = 0.23830165007287, lightsteelblue = 0.53983888284666, lightyellow = 0.98161818392882, lime = 0.7152, limegreen = 0.44571042246098, linen = 0.88357340984379, magenta = 0.2848, maroon = 0.045891942324215, mediumaquamarine = 0.49389703310801, mediumblue = 0.044077780212328, mediumorchid = 0.21639251153773, mediumpurple = 0.22905858091648, mediumseagreen = 0.34393112338131, mediumslateblue = 0.20284629471622, mediumspringgreen = 0.70704308194184, mediumturquoise = 0.5133827926448, mediumvioletred = 0.14371899849357, midnightblue = 0.02071786635086, mintcream = 0.97834604947588, mistyrose = 0.82183047859185, moccasin = 0.80083000991567, navajowhite = 0.76519682342785, navy = 0.015585128108224, oldlace = 0.91900633405549, olive = 0.20027537200568, olivedrab = 0.22593150951929, orange = 0.4817026703631, orangered = 0.25516243753416, orchid = 0.31348806761439, palegoldenrod = 0.78792647887614, palegreen = 0.77936759006353, paleturquoise = 0.76436077921714, palevioletred = 0.28754994117889, papayawhip = 0.87797100199835, peachpuff = 0.74905589878251, peru = 0.30113074877936, pink = 0.63271070702466, plum = 0.45734221587969, powderblue = 0.68254586500605, purple = 0.061477070432439, rebeccapurple = 0.07492341159447, red = 0.2126, rosybrown = 0.32319457649407, royalblue = 0.16663210743188, saddlebrown = 0.097922285020521, salmon = 0.36977241527596, sandybrown = 0.46628543696283, seagreen = 0.19734199706275, seashell = 0.92737862206922, sienna = 0.13697631337098, silver = 0.52711512570581, skyblue = 0.55291668518184, slateblue = 0.14784278062136, slategray = 0.20896704076536, slategrey = 0.20896704076536, snow = 0.96533341834849, springgreen = 0.73052306068529, steelblue = 0.20562642207625, tan = 0.48237604163921, teal = 0.16996855778968, thistle = 0.56818401093733, tomato = 0.30638612719415, turquoise = 0.5895536427578, violet = 0.40315452986676, wheat = 0.74909702820482, white = 1, whitesmoke = 0.91309865179342, yellow = 0.9278, yellowgreen = 0.50762957208707, } 6ae47fdb24de4eed5ec26d203faf5341a388987b モジュール:Color contrast 828 66 144 2021-05-21T19:05:06Z ja>えのきだたもつ 0 「[[モジュール:Color contrast]]」を保護しました: [[Wikipedia:保護の方針#半永久的な保護]]「[[Wikipedia:影響が特に大きいテンプレート|影響が特に大きいテンプレート]]」に基づき無期限拡張半保護 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) Scribunto text/plain -- -- This module implements -- {{Color contrast ratio}} -- {{Greater color contrast ratio}} -- {{ColorToLum}} -- {{RGBColorToLum}} -- local p = {} local HTMLcolor = mw.loadData( 'Module:Color contrast/colors' ) local function sRGB (v) if (v <= 0.03928) then v = v / 12.92 else v = math.pow((v+0.055)/1.055, 2.4) end return v end local function rgbdec2lum(R, G, B) if ( 0 <= R and R < 256 and 0 <= G and G < 256 and 0 <= B and B < 256 ) then return 0.2126 * sRGB(R/255) + 0.7152 * sRGB(G/255) + 0.0722 * sRGB(B/255) else return '' end end local function hsl2lum(h, s, l) if ( 0 <= h and h < 360 and 0 <= s and s <= 1 and 0 <= l and l <= 1 ) then local c = (1 - math.abs(2*l - 1))*s local x = c*(1 - math.abs( math.fmod(h/60, 2) - 1) ) local m = l - c/2 local r, g, b = m, m, m if( 0 <= h and h < 60 ) then r = r + c g = g + x elseif( 60 <= h and h < 120 ) then r = r + x g = g + c elseif( 120 <= h and h < 180 ) then g = g + c b = b + x elseif( 180 <= h and h < 240 ) then g = g + x b = b + c elseif( 240 <= h and h < 300 ) then r = r + x b = b + c elseif( 300 <= h and h < 360 ) then r = r + c b = b + x end return rgbdec2lum(255*r, 255*g, 255*b) else return '' end end local function color2lum(c) if (c == nil) then return '' end -- html '#' entity c = c:gsub("&#35;", "#") -- whitespace c = c:match( '^%s*(.-)[%s;]*$' ) -- unstrip nowiki strip markers c = mw.text.unstripNoWiki(c) -- lowercase c = c:lower() -- first try to look it up local L = HTMLcolor[c] if (L ~= nil) then return L end -- convert from hsl if mw.ustring.match(c,'^hsl%([%s]*[0-9][0-9%.]*[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then local h, s, l = mw.ustring.match(c,'^hsl%([%s]*([0-9][0-9%.]*)[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$') return hsl2lum(tonumber(h), tonumber(s)/100, tonumber(l)/100) end -- convert from rgb if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*%)$') then local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*%)$') return rgbdec2lum(tonumber(R), tonumber(G), tonumber(B)) end -- convert from rgb percent if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$') return rgbdec2lum(255*tonumber(R)/100, 255*tonumber(G)/100, 255*tonumber(B)/100) end -- remove leading # (if there is one) and whitespace c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$') -- split into rgb local cs = mw.text.split(c or '', '') if( #cs == 6 ) then local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[2]) local G = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[4]) local B = 16*tonumber('0x' .. cs[5]) + tonumber('0x' .. cs[6]) return rgbdec2lum(R, G, B) elseif ( #cs == 3 ) then local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[1]) local G = 16*tonumber('0x' .. cs[2]) + tonumber('0x' .. cs[2]) local B = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[3]) return rgbdec2lum(R, G, B) end -- failure, return blank return '' end -- This exports the function for use in other modules. -- The colour is passed as a string. function p._lum(color) return color2lum(color) end function p._greatercontrast(args) local bias = tonumber(args['bias'] or '0') or 0 local css = (args['css'] and args['css'] ~= '') and true or false local v1 = color2lum(args[1] or '') local c2 = args[2] or '#FFFFFF' local v2 = color2lum(c2) local c3 = args[3] or '#000000' local v3 = color2lum(c3) local ratio1 = -1; local ratio2 = -1; if (type(v1) == 'number' and type(v2) == 'number') then ratio1 = (v2 + 0.05)/(v1 + 0.05) ratio1 = (ratio1 < 1) and 1/ratio1 or ratio1 end if (type(v1) == 'number' and type(v3) == 'number') then ratio2 = (v3 + 0.05)/(v1 + 0.05) ratio2 = (ratio2 < 1) and 1/ratio2 or ratio2 end if css then local c1 = args[1] or '' if mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then c1 = '#' .. c1 end if mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then c2 = '#' .. c2 end if mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then c3 = '#' .. c3 end return 'background-color:' .. c1 .. '; color:' .. ((ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or '') .. ';' end return (ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or '' end function p._ratio(args) local v1 = color2lum(args[1]) local v2 = color2lum(args[2]) if (type(v1) == 'number' and type(v2) == 'number') then -- v1 should be the brighter of the two. if v2 > v1 then v1, v2 = v2, v1 end return (v1 + 0.05)/(v2 + 0.05) else return args['error'] or '?' end end function p._styleratio(args) local style = (args[1] or ''):lower() local bg, fg = 'white', 'black' local lum_bg, lum_fg = 1, 0 if args[2] then local lum = color2lum(args[2]) if lum ~= '' then bg, lum_bg = args[2], lum end end if args[3] then local lum = color2lum(args[3]) if lum ~= '' then fg, lum_fg = args[3], lum end end local slist = mw.text.split(mw.ustring.gsub(mw.ustring.gsub(style or '', '&#[Xx]23;', '#'), '&#35;', '#'), ';') for k = 1,#slist do local s = slist[k] local k,v = s:match( '^[%s]*([^:]-):([^:]-)[%s;]*$' ) k = k or '' v = v or '' if (k:match('^[%s]*(background)[%s]*$') or k:match('^[%s]*(background%-color)[%s]*$')) then local lum = color2lum(v) if( lum ~= '' ) then bg, lum_bg = v, lum end elseif (k:match('^[%s]*(color)[%s]*$')) then local lum = color2lum(v) if( lum ~= '' ) then bg, lum_fg = v, lum end end end if lum_bg > lum_fg then return (lum_bg + 0.05)/(lum_fg + 0.05) else return (lum_fg + 0.05)/(lum_bg + 0.05) end end --[[ Use {{#invoke:Color contrast|somecolor}} directly or {{#invoke:Color contrast}} from a wrapper template. Parameters: -- |1= — required; A color to check. --]] function p.lum(frame) local color = frame.args[1] or frame:getParent().args[1] return p._lum(color) end function p.ratio(frame) local args = frame.args[1] and frame.args or frame:getParent().args return p._ratio(args) end function p.styleratio(frame) local args = frame.args[1] and frame.args or frame:getParent().args return p._styleratio(args) end function p.greatercontrast(frame) local args = frame.args[1] and frame.args or frame:getParent().args return p._greatercontrast(args) end return p 1e399769117591366a63f62996c9a407077cc711 モジュール:Infobox/former/doc 828 47 106 2021-05-31T10:22:10Z ja>Q8j-2 0 +{{使用箇所の多いテンプレート}} wikitext text/x-wiki <includeonly>{{使用箇所の多いテンプレート|550,000以上}}</includeonly> 338a35e0387b9dedef216b30f3d69856a08bad7f テンプレート:Documentation subpage 10 45 102 2021-06-08T04:45:27Z ja>ネイ 0 「[[Template:Documentation subpage]]」の保護レベルを変更しました: [[WP:HRT|影響が特に大きいテンプレート]]: システムメッセージ([[MediaWiki:Scribunto-doc-page-header]])で使用 ([編集=管理者のみ許可] (無期限) [移動=管理者のみ許可] (無期限)) wikitext text/x-wiki <onlyinclude><includeonly>{{ #ifeq: {{lc:{{SUBPAGENAME}}}} | {{{override|doc}}} | <!-- doc page --> </includeonly>{{ #ifeq: {{{doc-notice|show}}} | show | <!-- doc-notice show -->{{Ombox | type = notice | image = [[File:Edit-copy green.svg|40px]] | text = '''これは{{{1|[[{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}の[[Help:テンプレートの説明文|解説]][[Help:サブページ|サブページ]]です。'''<br />使用方法、[[Help:カテゴリ|カテゴリ]]、およびその他{{{種類|{{ #if: {{SUBJECTSPACE}} |{{SUBJECTSPACE ja}}ページ|記事}}}}}自体に含まれない情報を収容しています。 }} | <!-- doc-notice hide --> }}<includeonly> |<!-- not doc --> }}</includeonly><includeonly>{{ #ifeq: {{SUBPAGENAME}} | doc | {{ #ifeq: {{NAMESPACE}} | {{ns:10}} | [[Category:テンプレート文書|{{PAGENAME}}]] }} }}</includeonly></onlyinclude> {{Documentation}} 89540d8504640ca8921525ee47f5b8b2c093e737 モジュール:String 828 14 40 2021-06-25T04:22:11Z ja>ネイ 0 [[:en:Module:String]] oldid=970815276 より更新 Scribunto text/plain --[[ This module is intended to provide access to basic string functions. Most of the functions provided here can be invoked with named parameters, unnamed parameters, or a mixture. If named parameters are used, Mediawiki will automatically remove any leading or trailing whitespace from the parameter. Depending on the intended use, it may be advantageous to either preserve or remove such whitespace. Global options ignore_errors: If set to 'true' or 1, any error condition will result in an empty string being returned rather than an error message. error_category: If an error occurs, specifies the name of a category to include with the error message. The default category is [Category:モジュールStringのエラー]. no_category: If set to 'true' or 1, no category will be added if an error is generated. Unit tests for this module are available at Module:String/tests. ]] local str = {} --[[ len This function returns the length of the target string. Usage: {{#invoke:String|len|target_string|}} OR {{#invoke:String|len|s=target_string}} Parameters s: The string whose length to report If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the target string. ]] function str.len( frame ) local new_args = str._getParameters( frame.args, {'s'} ) local s = new_args['s'] or '' return mw.ustring.len( s ) end --[[ sub This function returns a substring of the target string at specified indices. Usage: {{#invoke:String|sub|target_string|start_index|end_index}} OR {{#invoke:String|sub|s=target_string|i=start_index|j=end_index}} Parameters s: The string to return a subset of i: The fist index of the substring to return, defaults to 1. j: The last index of the string to return, defaults to the last character. The first character of the string is assigned an index of 1. If either i or j is a negative value, it is interpreted the same as selecting a character by counting from the end of the string. Hence, a value of -1 is the same as selecting the last character of the string. If the requested indices are out of range for the given string, an error is reported. ]] function str.sub( frame ) local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } ) local s = new_args['s'] or '' local i = tonumber( new_args['i'] ) or 1 local j = tonumber( new_args['j'] ) or -1 local len = mw.ustring.len( s ) -- Convert negatives for range checking if i < 0 then i = len + i + 1 end if j < 0 then j = len + j + 1 end if i > len or j > len or i < 1 or j < 1 then return str._error( 'String subset index out of range' ) end if j < i then return str._error( 'String subset indices out of order' ) end return mw.ustring.sub( s, i, j ) end --[[ This function implements that features of {{str sub old}} and is kept in order to maintain these older templates. ]] function str.sublength( frame ) local i = tonumber( frame.args.i ) or 0 local len = tonumber( frame.args.len ) return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) ) end --[[ _match This function returns a substring from the source string that matches a specified pattern. It is exported for use in other modules Usage: strmatch = require("Module:String")._match sresult = strmatch( s, pattern, start, match, plain, nomatch ) Parameters s: The string to search pattern: The pattern or string to find within the string start: The index within the source string to start the search. The first character of the string has index 1. Defaults to 1. match: In some cases it may be possible to make multiple matches on a single string. This specifies which match to return, where the first match is match= 1. If a negative number is specified then a match is returned counting from the last match. Hence match = -1 is the same as requesting the last match. Defaults to 1. plain: A flag indicating that the pattern should be understood as plain text. Defaults to false. nomatch: If no match is found, output the "nomatch" value rather than an error. For information on constructing Lua patterns, a form of [regular expression], see: * http://www.lua.org/manual/5.1/manual.html#5.4.1 * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns ]] -- This sub-routine is exported for use in other modules function str._match( s, pattern, start, match_index, plain_flag, nomatch ) if s == '' then return str._error( 'Target string is empty' ) end if pattern == '' then return str._error( 'Pattern string is empty' ) end start = tonumber(start) or 1 if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then return str._error( 'Requested start is out of range' ) end if match_index == 0 then return str._error( 'Match index is out of range' ) end if plain_flag then pattern = str._escapePattern( pattern ) end local result if match_index == 1 then -- Find first match is simple case result = mw.ustring.match( s, pattern, start ) else if start > 1 then s = mw.ustring.sub( s, start ) end local iterator = mw.ustring.gmatch(s, pattern) if match_index > 0 then -- Forward search for w in iterator do match_index = match_index - 1 if match_index == 0 then result = w break end end else -- Reverse search local result_table = {} local count = 1 for w in iterator do result_table[count] = w count = count + 1 end result = result_table[ count + match_index ] end end if result == nil then if nomatch == nil then return str._error( 'Match not found' ) else return nomatch end else return result end end --[[ match This function returns a substring from the source string that matches a specified pattern. Usage: {{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}} OR {{#invoke:String|match|s=source_string|pattern=pattern_string|start=start_index |match=match_number|plain=plain_flag|nomatch=nomatch_output}} Parameters s: The string to search pattern: The pattern or string to find within the string start: The index within the source string to start the search. The first character of the string has index 1. Defaults to 1. match: In some cases it may be possible to make multiple matches on a single string. This specifies which match to return, where the first match is match= 1. If a negative number is specified then a match is returned counting from the last match. Hence match = -1 is the same as requesting the last match. Defaults to 1. plain: A flag indicating that the pattern should be understood as plain text. Defaults to false. nomatch: If no match is found, output the "nomatch" value rather than an error. If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from each string. In some circumstances this is desirable, in other cases one may want to preserve the whitespace. If the match_number or start_index are out of range for the string being queried, then this function generates an error. An error is also generated if no match is found. If one adds the parameter ignore_errors=true, then the error will be suppressed and an empty string will be returned on any failure. For information on constructing Lua patterns, a form of [regular expression], see: * http://www.lua.org/manual/5.1/manual.html#5.4.1 * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns ]] -- This is the entry point for #invoke:String|match function str.match( frame ) local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} ) local s = new_args['s'] or '' local start = tonumber( new_args['start'] ) or 1 local plain_flag = str._getBoolean( new_args['plain'] or false ) local pattern = new_args['pattern'] or '' local match_index = math.floor( tonumber(new_args['match']) or 1 ) local nomatch = new_args['nomatch'] return str._match( s, pattern, start, match_index, plain_flag, nomatch ) end --[[ pos This function returns a single character from the target string at position pos. Usage: {{#invoke:String|pos|target_string|index_value}} OR {{#invoke:String|pos|target=target_string|pos=index_value}} Parameters target: The string to search pos: The index for the character to return If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the target string. In some circumstances this is desirable, in other cases one may want to preserve the whitespace. The first character has an index value of 1. If one requests a negative value, this function will select a character by counting backwards from the end of the string. In other words pos = -1 is the same as asking for the last character. A requested value of zero, or a value greater than the length of the string returns an error. ]] function str.pos( frame ) local new_args = str._getParameters( frame.args, {'target', 'pos'} ) local target_str = new_args['target'] or '' local pos = tonumber( new_args['pos'] ) or 0 if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then return str._error( 'String index out of range' ) end return mw.ustring.sub( target_str, pos, pos ) end --[[ str_find This function duplicates the behavior of {{str_find}}, including all of its quirks. This is provided in order to support existing templates, but is NOT RECOMMENDED for new code and templates. New code is recommended to use the "find" function instead. Returns the first index in "source" that is a match to "target". Indexing is 1-based, and the function returns -1 if the "target" string is not present in "source". Important Note: If the "target" string is empty / missing, this function returns a value of "1", which is generally unexpected behavior, and must be accounted for separatetly. ]] function str.str_find( frame ) local new_args = str._getParameters( frame.args, {'source', 'target'} ) local source_str = new_args['source'] or '' local target_str = new_args['target'] or '' if target_str == '' then return 1 end local start = mw.ustring.find( source_str, target_str, 1, true ) if start == nil then start = -1 end return start end --[[ find This function allows one to search for a target string or pattern within another string. Usage: {{#invoke:String|find|source_str|target_string|start_index|plain_flag}} OR {{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}} Parameters source: The string to search target: The string or pattern to find within source start: The index within the source string to start the search, defaults to 1 plain: Boolean flag indicating that target should be understood as plain text and not as a Lua style regular expression, defaults to true If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the parameter. In some circumstances this is desirable, in other cases one may want to preserve the whitespace. This function returns the first index >= "start" where "target" can be found within "source". Indices are 1-based. If "target" is not found, then this function returns 0. If either "source" or "target" are missing / empty, this function also returns 0. This function should be safe for UTF-8 strings. ]] function str.find( frame ) local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } ) local source_str = new_args['source'] or '' local pattern = new_args['target'] or '' local start_pos = tonumber(new_args['start']) or 1 local plain = new_args['plain'] or true if source_str == '' or pattern == '' then return 0 end plain = str._getBoolean( plain ) local start = mw.ustring.find( source_str, pattern, start_pos, plain ) if start == nil then start = 0 end return start end --[[ replace This function allows one to replace a target string or pattern within another string. Usage: {{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}} OR {{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string| count=replacement_count|plain=plain_flag}} Parameters source: The string to search pattern: The string or pattern to find within source replace: The replacement text count: The number of occurences to replace, defaults to all. plain: Boolean flag indicating that pattern should be understood as plain text and not as a Lua style regular expression, defaults to true ]] function str.replace( frame ) local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } ) local source_str = new_args['source'] or '' local pattern = new_args['pattern'] or '' local replace = new_args['replace'] or '' local count = tonumber( new_args['count'] ) local plain = new_args['plain'] or true if source_str == '' or pattern == '' then return source_str end plain = str._getBoolean( plain ) if plain then pattern = str._escapePattern( pattern ) replace = mw.ustring.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences. end local result if count ~= nil then result = mw.ustring.gsub( source_str, pattern, replace, count ) else result = mw.ustring.gsub( source_str, pattern, replace ) end return result end --[[ simple function to pipe string.rep to templates. ]] function str.rep( frame ) local repetitions = tonumber( frame.args[2] ) if not repetitions then return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' ) end return string.rep( frame.args[1] or '', repetitions ) end --[[ escapePattern This function escapes special characters from a Lua string pattern. See [1] for details on how patterns work. [1] https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns Usage: {{#invoke:String|escapePattern|pattern_string}} Parameters pattern_string: The pattern string to escape. ]] function str.escapePattern( frame ) local pattern_str = frame.args[1] if not pattern_str then return str._error( 'No pattern string specified' ) end local result = str._escapePattern( pattern_str ) return result end --[[ count This function counts the number of occurrences of one string in another. ]] function str.count(frame) local args = str._getParameters(frame.args, {'source', 'pattern', 'plain'}) local source = args.source or '' local pattern = args.pattern or '' local plain = str._getBoolean(args.plain or true) if plain then pattern = str._escapePattern(pattern) end local _, count = mw.ustring.gsub(source, pattern, '') return count end --[[ endswith This function determines whether a string ends with another string. ]] function str.endswith(frame) local args = str._getParameters(frame.args, {'source', 'pattern'}) local source = args.source or '' local pattern = args.pattern or '' if pattern == '' then -- All strings end with the empty string. return "yes" end if mw.ustring.sub(source, -mw.ustring.len(pattern), -1) == pattern then return "yes" else return "" end end --[[ join Join all non empty arguments together; the first argument is the separator. Usage: {{#invoke:String|join|sep|one|two|three}} ]] function str.join(frame) local args = {} local sep for _, v in ipairs( frame.args ) do if sep then if v ~= '' then table.insert(args, v) end else sep = v end end return table.concat( args, sep or '' ) end --[[ Helper function that populates the argument list given that user may need to use a mix of named and unnamed parameters. This is relevant because named parameters are not identical to unnamed parameters due to string trimming, and when dealing with strings we sometimes want to either preserve or remove that whitespace depending on the application. ]] function str._getParameters( frame_args, arg_list ) local new_args = {} local index = 1 local value for _, arg in ipairs( arg_list ) do value = frame_args[arg] if value == nil then value = frame_args[index] index = index + 1 end new_args[arg] = value end return new_args end --[[ Helper function to handle error messages. ]] function str._error( error_str ) local frame = mw.getCurrentFrame() local error_category = frame.args.error_category or 'モジュールStringのエラー' local ignore_errors = frame.args.ignore_errors or false local no_category = frame.args.no_category or false if str._getBoolean(ignore_errors) then return '' end local error_str = '<strong class="error">モジュールStringのエラー: ' .. error_str .. '</strong>' if error_category ~= '' and not str._getBoolean( no_category ) then error_str = '[[Category:' .. error_category .. ']]' .. error_str end return error_str end --[[ Helper Function to interpret boolean strings ]] function str._getBoolean( boolean_str ) local boolean_value if type( boolean_str ) == 'string' then boolean_str = boolean_str:lower() if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0' or boolean_str == '' then boolean_value = false else boolean_value = true end elseif type( boolean_str ) == 'boolean' then boolean_value = boolean_str else error( 'No boolean value found' ) end return boolean_value end --[[ Helper function that escapes all pattern characters so that they will be treated as plain text. ]] function str._escapePattern( pattern_str ) return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" ) end return str e8c19fe00abea312d12f4cedce55de799764d7fc テンプレート:Clear 10 31 74 2021-07-03T06:39:24Z ja>ネイ 0 -pp-template wikitext text/x-wiki <div style="clear:{{{1|both}}};"></div><noinclude> {{documentation}} </noinclude> 38bab3e3d7fbd3d6800d46556e60bc6bac494d72 テンプレート:Infobox 10 8 28 2021-07-06T16:55:30Z ja>ネイ 0 +includeonly wikitext text/x-wiki <includeonly>{{#invoke:infobox/former|main}}</includeonly><noinclude>{{documentation}}</noinclude> 4a97880488542cb91a07c1e4815b083755983b8f テンプレート:Infobox/doc 10 9 30 2021-08-28T22:07:10Z ja>Call Tenderas 0 600000 wikitext text/x-wiki <noinclude>{{Documentation subpage}}</noinclude> <includeonly>{{使用箇所の多いテンプレート|600,000以上}}{{Lua|モジュール:Infobox/former}}</includeonly> {{Main|Help:Infobox}} == 使い方 == このテンプレートはメタテンプレート(他のテンプレートを作成するときに使われるテンプレート)として使われることを想定しています。記事に直接使われることを想定していません。<!--ページが無いのでコメントアウト→一般的なInfoboxの作り方については[[Help:Infobox]]を見てください。--> 使い方は{{Tl|Navbox}}に似ていますが、追加された機能があります。テーブルの各行は「見出し」(header) でも、ラベルとデータ対でも、単なるデータセルでもありえます。また、ある行に見出しとラベル/データ対の両方を定義すれば、ラベル/データ対は無視されます。 Infoboxの最上部以外のどこかで画像を挿入したい場合、あるいは他の「自由な形式」のデータを挿入したい場合、<!-- そのような使用を許している -->“data”フィールドによる行を使うように注意してください。 === パラメータ === このテンプレートでは全てのパラメータを省略可能です。 ==== タイトル ==== タイトルをキャプションにする場合にはtitle、最上部のヘッダセルにする場合にはaboveを使います。通常はどちらか片方を使いますが、両方使うこともできます。 ; title : 表のキャプションに置くテキストです。 ; above : 表の最上部に置くテキストです。 ; subheader<var>n</var> : 表の最上部と画像の間に表示されるテキストです。<var>n</var>を指定しない場合は“<var>n</var>=1”と見なされます。 ==== テキストなど ==== ; name(または tnavbar) : 表の最下部の、テンプレート本体へのリンクを表示するために必要なテンプレート名です。<nowiki>{{subst:PAGENAME}}</nowiki>を使うことができますが、<nowiki><includeonly></includeonly></nowiki>をはさんでいる場合はsubst展開されないので注意してください。指定が無い場合はリンクが表示されません。 ; image<var>n</var> : テンプレートの上部に表示される画像です。<nowiki>[[ファイル:example.png|200px]]</nowiki>のような、完全な画像構文を使ってください。デフォルトで中央に表示されます。<var>n</var>を指定しない場合は“<var>n</var>=1”と見なされます。 ; caption<var>n</var> : 画像の下に置くテキストです。<var>n</var>を指定しない場合は“<var>n</var>=1”と見なされます。 ; header<var>n</var> : 列<var>n</var>のヘッダとして使うテキストです。 ; label<var>n</var>: 列<var>n</var>のラベルとして使うテキストです。 ; data<var>n</var>: 列<var>n</var>のデータとして表示されるテキストです。 ; below : 最下行に置くテキストです。脚注、関連項目、その他の情報として使われることを想定しています。 ==== CSSスタイル ==== ; bodystyle : Infobox全体のスタイル指定です。 ; titlestyle : タイトルセルだけのスタイル指定です。 ; abovestyle : 表の最上部のセルだけのスタイル指定です。 ; imagestyle : 画像があるセル(captionも含む)のスタイル指定です。 ; captionstyle : captionのテキストのスタイル指定です。 ; headerstyle : 全てのヘッダセルのスタイル指定です。 ; headerstyle<var>n</var>: header<var>n</var>セルのスタイル指定です。<br />中国語版などで使われているTemplate:Infoboxとはheader<var>n</var>style。翻訳時にテンプレートを変える場合は注意してください。 ; labelstyle : 全てのラベルセルのスタイル指定です。 ; labelstyle<var>n</var>: label<var>n</var>セルのスタイル指定です。<br />中国語版などで使われているTemplate:Infoboxとはlabel<var>n</var>style。翻訳時にテンプレートを変える場合は注意してください。 ; datastyle : 全てのデータセルのスタイル指定です。 ; datastyle<var>n</var>: data<var>n</var>セルのスタイル指定です。<br />中国語版などで使われているTemplate:Infoboxとはdata<var>n</var>style。翻訳時にテンプレートを変える場合は注意してください。 ; belowstyle : 最下行のセルだけのスタイル指定です。 ==== クラス ==== ; bodyclass : このパラメータは、Infobox全体の「class」属性に挿入されます。デフォルトは <code>infobox</code> です。そのため、このパラメータに <code>bordered</code> と記述すると <code>infobox bordered</code> となるので、表全体に罫線が引かれます。 ; titleclass : タイトルセルだけのクラス指定です。 ; subheaderrowclass : subheaderのある行のクラス指定です。 ; subheaderclass : subheaderのテキストのクラス指定です。 ; aboveclass : 表の最上部のセルだけのクラス指定です。 ; imagerowclass : 画像がある行(captionも含む)のクラス指定です。 ; imageclass : 画像があるセル(captionも含む)のクラス指定です。 ; rowclass<var>n</var> : header<var>n</var>またはdata<var>n</var>のある行のクラス指定です。 ; class<var>n</var> : data<var>n</var>セルのクラス指定です。 ; belowclass : 表の最下行のセルだけのクラス指定です。 ==== マイクロデータ ==== ; bodyitemtype : 表全体のタイプ (URI) 指定です。 ; bodyitemref : 表全体の参照するスコープ部分以外のID指定です。 ; rowitemprop<var>n</var> : header<var>n</var>またはdata<var>n</var>のある行全体のプロパティ指定です。 ; rowitemtype<var>n</var> : header<var>n</var>またはdata<var>n</var>のある行全体のタイプ (URI) 指定です。 ; rowitemref<var>n</var> : header<var>n</var>またはdata<var>n</var>のある行全体の参照するスコープ部分以外のID指定です。 ; itemprop<var>n</var> : data<var>n</var>セルのプロパティ指定です。 ; itemtype<var>n</var> : data<var>n</var>セルのタイプ (URI) 指定です。 ; itemref<var>n</var> : data<var>n</var>セルの参照するスコープ部分以外のID指定です。 ; id<var>n</var> : data<var>n</var>セルのID指定です。 ==== 組み込み ==== Infoboxテンプレートの<code>data<var>n</var></code>に{{para|child}}のパラメータを設定したInfoboxテンプレートの構文を記述することでInfobox内に別のInfoboxを組み込むことが出来ます。項目数を拡張した基礎情報テンプレートを作成できるなどの利点があります。{{para|child}}を設定しないと二重に罫線が書かれるため見た目がよくありません。 {{Infobox | data1 = {{Infobox | child = yes | title = 第1サブセクション | label1 = ラベル1.1 | data1 = データ1.1 }} | data2 = {{Infobox | child = yes | title = 第2サブセクション | label1 = ラベル2.1 | data1 = データ2.1 }} | belowstyle = | below = 最下部テキスト }} <pre style="overflow:auto">{{Infobox | data1 = {{Infobox | child = yes | title = 第1サブセクション | label1 = ラベル1.1 | data1 = データ1.1 }} | data2 = {{Infobox | child = yes | title = 第2サブセクション | label1 = ラベル2.1 | data1 = データ2.1 }} | belowstyle = | below = 最下部テキスト }}</pre> == 表示例 == {{Multicol|45em}} === 通常 === {{Infobox | title = title | above = above | abovestyle = background-color:#ccf | headerstyle = background-color:#ccf | subheader = subheader | subheader2 = subheader2 | image = [[ファイル:Example.svg|200px]] | caption = caption | image2 = [[ファイル:Example.svg|200px]] | caption2 = caption2 | header1 = header1 | label2 = label2 | data2 = data2 | belowstyle = background-color:#ccf | below = below }} {{Multicol-break}} === bodyclassにborderedを指定 === {{Infobox | bodyclass = bordered | title = title | above = above | abovestyle = background-color:#ccf | headerstyle = background-color:#ccf | subheader = subheader | subheader2 = subheader2 | image = [[ファイル:Example.svg|200px]] | caption = caption | image2 = [[ファイル:Example.svg|200px]] | caption2 = caption2 | header1 = header1 | label2 = label2 | data2 = data2 | belowstyle = background-color:#ccf | below = below }} {{multicol-end}} {{Clear}} == フォーマット == <pre style="overflow:auto">{{Infobox | bodyclass = | bodystyle = | bodyitemtype = | bodyitemref = | titleclass = | titlestyle = | title = | aboveclass = | abovestyle = | above = | subheaderstyle = | subheader = | subheader2 = . . . | imagestyle = | captionstyle = | image = | caption = | image2 = | caption2 = . . . | header1 = | label1 = | labelstyle1 = | data1 = | datastyle1 = | class1 = | id1 = | rowitemprop1 = | rowitemtype1 = | rowitemref1 = | itemprop1 = | itemtype1 = | itemref1 = | header2 = | label2 = | labelstyle2 = | data2 = | datastyle2 = | class2 = | id2 = | rowitemtype2 = | rowitemref2 = | itemprop2 = | itemtype2 = | itemref2 = . . . | belowclass = | belowstyle = | below = }} </pre> === 関連テンプレート === * {{tl|infobox3cols}} <includeonly>{{Sandbox other|| <!--カテゴリは以下に追加してください--> {{デフォルトソート:{{PAGENAME}}}} [[Category:基礎情報テンプレート| ]] [[Category:メタテンプレート]] }}</includeonly> 3fe4a4aceddf2cd1004a93eaaf4f8db67fd2c6e0 モジュール:File link 828 24 60 2021-08-30T08:12:49Z ja>ネイ 0 エラーメッセージの日本語訳 Scribunto text/plain -- This module provides a library for formatting file wikilinks. local yesno = require('Module:Yesno') local checkType = require('libraryUtil').checkType local p = {} function p._main(args) checkType('_main', 1, args, 'table') -- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our -- own function to get the right error level. local function checkArg(key, val, level) if type(val) ~= 'string' then error(string.format( "'_main'関数における'%s'引数のタイプエラー(想定:文字列、実際:%s)", key, type(val) ), level) end end local ret = {} -- Adds a positional parameter to the buffer. local function addPositional(key) local val = args[key] if not val then return nil end checkArg(key, val, 4) ret[#ret + 1] = val end -- Adds a named parameter to the buffer. We assume that the parameter name -- is the same as the argument key. local function addNamed(key) local val = args[key] if not val then return nil end checkArg(key, val, 4) ret[#ret + 1] = key .. '=' .. val end -- Filename checkArg('file', args.file, 3) ret[#ret + 1] = 'File:' .. args.file -- Format if args.format then checkArg('format', args.format) if args.formatfile then checkArg('formatfile', args.formatfile) ret[#ret + 1] = args.format .. '=' .. args.formatfile else ret[#ret + 1] = args.format end end -- Border if yesno(args.border) then ret[#ret + 1] = 'border' end addPositional('location') addPositional('alignment') addPositional('size') addNamed('upright') addNamed('link') addNamed('alt') addNamed('page') addNamed('class') addNamed('lang') addNamed('start') addNamed('end') addNamed('thumbtime') addPositional('caption') return string.format('[[%s]]', table.concat(ret, '|')) end function p.main(frame) local origArgs = require('Module:Arguments').getArgs(frame, { wrappers = 'Template:File link' }) if not origArgs.file then error("[[Template:File link]]のエラー: 'file'引数が未入力です", 0) end -- Copy the arguments that were passed to a new table to avoid looking up -- every possible parameter in the frame object. local args = {} for k, v in pairs(origArgs) do -- Make _BLANK a special argument to add a blank parameter. For use in -- conditional templates etc. it is useful for blank arguments to be -- ignored, but we still need a way to specify them so that we can do -- things like [[File:Example.png|link=]]. if v == '_BLANK' then v = '' end args[k] = v end return p._main(args) end return p fadb7b1349eacd06b7ce6be9d990375fab67cfb0 モジュール:Protection banner/config 828 27 66 2021-10-03T14:22:13Z ja>Marine-Blue 0 画像を差し替え Scribunto text/plain -- This module provides configuration data for [[Module:Protection banner]]. return { -------------------------------------------------------------------------------- -- -- BANNER DATA -- -------------------------------------------------------------------------------- --[[ -- Banner data consists of six fields: -- * text - the main protection text that appears at the top of protection -- banners. -- * explanation - the text that appears below the main protection text, used -- to explain the details of the protection. -- * tooltip - the tooltip text you see when you move the mouse over a small -- padlock icon. -- * link - the page that the small padlock icon links to. -- * alt - the alt text for the small padlock icon. This is also used as tooltip -- text for the large protection banners. -- * image - the padlock image used in both protection banners and small padlock -- icons. -- -- The module checks in three separate tables to find a value for each field. -- First it checks the banners table, which has values specific to the reason -- for the page being protected. Then the module checks the defaultBanners -- table, which has values specific to each protection level. Finally, the -- module checks the masterBanner table, which holds data for protection -- templates to use if no data has been found in the previous two tables. -- -- The values in the banner data can take parameters. These are specified -- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name -- enclosed in curly braces). -- -- Available parameters: -- -- ${CURRENTVERSION} - a link to the page history or the move log, with the -- display message "current-version-edit-display" or -- "current-version-move-display". -- -- ${EDITREQUEST} - a link to create an edit request for the current page. -- -- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes -- on the talk page; you may submit a request to ask an administrator to make -- an edit if it is minor or supported by consensus." -- -- ${IMAGELINK} - a link to set the image to, depending on the protection -- action and protection level. -- -- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry -- is set. E.g. "Editing of this page by new or unregistered users is currently -- disabled until dd Month YYYY." -- -- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation -- so that it can be used in run-on sentences. -- -- ${PAGETYPE} - the type of the page, e.g. "article" or "template". -- Defined in the cfg.pagetypes table. -- -- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g. -- "Editing of this page by new or unregistered users is currently disabled" -- -- ${PROTECTIONDATE} - the protection date, if it has been supplied to the -- template. -- -- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or -- "semi-protected". -- -- ${PROTECTIONLOG} - a link to the protection log or the pending changes log, -- depending on the protection action. -- -- ${TALKPAGE} - a link to the talk page. If a section is specified, links -- straight to that talk page section. -- -- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to -- create a blurb like "This template is semi-protected", or "This article is -- move-protected until DD Month YYYY". -- -- ${VANDAL} - links for the specified username (or the root page name) -- using Module:Vandal-m. -- -- Functions -- -- For advanced users, it is possible to use Lua functions instead of strings -- in the banner config tables. Using functions gives flexibility that is not -- possible just by using parameters. Functions take two arguments, the -- protection object and the template arguments, and they must output a string. -- -- For example: -- -- text = function (protectionObj, args) -- if protectionObj.level == 'autoconfirmed' then -- return 'foo' -- else -- return 'bar' -- end -- end -- -- Some protection object properties and methods that may be useful: -- protectionObj.action - the protection action -- protectionObj.level - the protection level -- protectionObj.reason - the protection reason -- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set -- to indefinite, and the protection time in unix time if temporary. -- protectionObj.protectionDate - the protection date in unix time, or nil if -- unspecified. -- protectionObj.bannerConfig - the banner config found by the module. Beware -- of editing the config field used by the function, as it could create an -- infinite loop. -- protectionObj:isProtected - returns a boolean showing whether the page is -- protected. -- protectionObj:isTemporary - returns a boolean showing whether the expiry is -- temporary. -- protectionObj:isIncorrect - returns a boolean showing whether the protection -- template is incorrect. --]] -- The master banner data, used if no values have been found in banners or -- defaultBanners. masterBanner = { text = '${INTROBLURB}', explanation = '${EXPLANATIONBLURB}', tooltip = '${TOOLTIPBLURB}', link = '${IMAGELINK}', alt = '${PROTECTIONLEVEL}されたページ' }, -- The default banner data. This holds banner data for different protection -- levels. -- *required* - this table needs edit, move, autoreview and upload subtables. defaultBanners = { edit = {}, move = {}, autoreview = { default = { alt = 'Page protected with pending changes', tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users', image = 'Pending-protection-shackle.svg' } }, upload = {} }, -- The banner data. This holds banner data for different protection reasons. -- In fact, the reasons specified in this table control which reasons are -- valid inputs to the first positional parameter. -- -- There is also a non-standard "description" field that can be used for items -- in this table. This is a description of the protection reason for use in the -- module documentation. -- -- *required* - this table needs edit, move, autoreview and upload subtables. banners = { edit = { --blp = { -- description = 'For pages protected to promote compliance with the' -- .. ' [[Wikipedia:Biographies of living persons' -- .. '|biographies of living persons]] policy', -- text = '${INTROFRAGMENT} to promote compliance with' -- .. ' [[Wikipedia:Biographies of living persons' -- .. "|Wikipedia's&nbsp;policy on&nbsp;the&nbsp;biographies" -- .. ' of&nbsp;living&nbsp;people]].', -- tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on' -- .. ' biographies of living persons', --}, dmca = { description = '[[デジタルミレニアム著作権法]]に基づく削除要求があったため、' .. '保護されたページ', explanation = function (protectionObj, args) local ret = 'この${PAGETYPE}の内容に関して、[[デジタルミレニアム著作権法]]' .. '(DMCA)に基づく権利所有者への通知があったため、' .. 'ウィキメディア財団は問題となった個所を削除した上で、' .. 'このページの編集を制限しました。' if args.notice then ret = ret .. '財団が受理した通知のコピーは ' .. args.notice .. ' にあります。' end ret = ret .. '異議申し立て方法など詳細な情報については' .. '[[Wikipedia:事務局行動]]および${TALKPAGE}をご覧ください。<br />' .. "'''編集制限が解除されるまで、" .. "このお知らせを除去しないでください。'''" return ret end, image = 'Office-protection-shackle-WMFlogo.svg', }, dispute = { description = '[[Wikipedia:編集合戦|編集合戦]]により保護されたページ', text = '[[Wikipedia:編集合戦|編集合戦]]が発生したため、${INTROBLURB}', explanation = "${CURRENTVERSION}の内容が'''適切とは限りません'''。" .. '詳しくは[[Wikipedia:保護の方針|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '問題となった個所について意見がある場合は、' .. '${TALKPAGE}で議論するよう心がけてください。' .. '[[Wikipedia:合意形成|合意が形成]]され、保護を解除できる状態になった場合は' .. '[[Wikipedia:保護解除依頼|保護の解除を依頼]]してください。', tooltip = '編集合戦が発生したため、${TOOLTIPBLURB}', }, --ecp = { -- description = 'For articles in topic areas authorized by' -- .. ' [[Wikipedia:Arbitration Committee|ArbCom]] or' -- .. ' meets the criteria for community use', -- tooltip = 'This ${PAGETYPE} is extended-confirmed protected', -- alt = 'Extended-protected ${PAGETYPE}', --}, --mainpage = { -- description = 'For pages protected for being displayed on the [[Main Page]]', -- text = 'This file is currently' -- .. ' [[Wikipedia:This page is protected|protected]] from' -- .. ' editing because it is currently or will soon be displayed' -- .. ' on the [[Main Page]].', -- explanation = 'Images on the Main Page are protected due to their high' -- .. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.' -- .. '<br /><span style="font-size:90%;">' -- .. "'''Administrators:''' Once this image is definitely off the Main Page," -- .. ' please unprotect this file, or reduce to semi-protection,' -- .. ' as appropriate.</span>', --}, office = { description = '[[Wikipedia:事務局行動|事務局行動]]により保護されたページ', text = function (protectionObj, args) local ret = '現在この${PAGETYPE}は[[Wikipedia:事務局行動|' .. 'ウィキメディア財団事務局]]の監視下にあり、' if protectionObj.protectionDate then ret = ret .. '${PROTECTIONDATE}以降、' end return ret .. '保護されています。' end, explanation = "もしあなたがこのページを編集できたとしても、加筆・修正を行う前に" .. "${TALKPAGE}で議論するよう心がけてください。<br />" .. "'''ウィキメディア財団の許可があるまで、このページの保護を" .. "解除しないでください。'''", image = 'Office-protection-shackle-WMFlogo.svg', }, permanent = { description = '半永久的に保護されているページ', text = function (protectionObj, args) if protectionObj.level == 'sysop' then return 'この${PAGETYPE}は、半永久的に編集[[Wikipedia:保護|保護]]されています。' elseif protectionObj.level == 'extendedconfirmed' then return 'この${PAGETYPE}は、[[Wikipedia:利用者#拡張承認された利用者|' .. '拡張承認された利用者]]以外の編集を半永久的に[[Wikipedia:保護|禁止]]しています。' else return 'この${PAGETYPE}は、[[Wikipedia:利用者#新規利用者|新規利用者]]' .. 'および[[Wikipedia:利用者#IP利用者|未登録利用者]]からの編集を' .. '半永久的に[[Wikipedia:保護|禁止]]しています。' end end, explanation = function (protectionObj, args) if protectionObj.level == 'sysop' then return '詳しくは[[Wikipedia:保護の方針#半永久的な保護|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '変更が必要なときは${TALKPAGE}で議論し、[[Wikipedia:合意形成|合意形成]]後に' .. '[[Wikipedia:管理者伝言板/保護ページ編集|保護編集依頼]]を行ってください。' elseif protectionObj.level == 'extendedconfirmed' then return '詳しくは[[Wikipedia:拡張半保護の方針#半永久的な拡張半保護|拡張半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. 'この${PAGETYPE}を編集することができない場合、${TALKPAGE}にて' .. '<code class="nowrap">{{[[Template:拡張半保護編集依頼|拡張半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:拡張半保護の方針#拡張半保護されたページの編集|編集を依頼]]するか、' .. '[[Wikipedia:管理者伝言板/拡張承認の申請|拡張承認の申請]]をしてください。' else return '詳しくは[[Wikipedia:半保護の方針#半永久的な半保護|半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. 'この${PAGETYPE}を編集することができない場合、${TALKPAGE}にて' .. '<code class="nowrap">{{[[Template:半保護編集依頼|半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:半保護の方針#半保護されたページの編集|編集を依頼]]してください。' end end, tooltip = '半永久的に${PROTECTIONLEVEL}されている${PAGETYPE}', alt = '半永久的に${PROTECTIONLEVEL}されている${PAGETYPE}', image = function (protectionObj) if protectionObj.level == 'sysop' then return 'Edit Semi-permanent Protection.svg' elseif protectionObj.level == 'extendedconfirmed' then return 'Edit Semi-permanent Extended Semi-protection.svg' else return 'Edit Semi-permanent Semi-protection.svg' end end, }, reset = { description = '[[Wikipedia:事務局行動|事務局行動]]により、内容が' .. '縮小された上で保護されたページ', text = function (protectionObj, args) local ret = '現在この${PAGETYPE}は[[Wikipedia:事務局行動|' .. 'ウィキメディア財団事務局]]の監視下にあり、' if protectionObj.protectionDate then ret = ret .. '${PROTECTIONDATE}以降、' end return ret .. '保護されています。' end, explanation = 'この${PAGETYPE}には最小限の内容しかないため、' .. '[[WP:NPOV|中立的な観点]]や[[WP:V|検証可能性]]といった方針に' .. '適合する形で、全面的に改稿されることが望まれています。' .. "もしあなたがこのページを編集できたとしても、加筆・修正を行う前に" .. "${TALKPAGE}で議論するよう心がけてください。<br />" .. 'この${PAGETYPE}が保護される以前の版に書かれていた内容は' .. '復帰させないでください。' .. 'ノートページで議論を行う際も同様です。<br />' .. "'''ウィキメディア財団の許可があるまで、このページの保護を" .. "解除したり、このお知らせを除去しないでください。'''", image = 'Office-protection-shackle-WMFlogo.svg', }, --sock = { -- description = 'For pages protected due to' -- .. ' [[Wikipedia:Sock puppetry|sock puppetry]]', -- text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of' -- .. ' [[Wikipedia:Blocking policy|blocked]] or' -- .. ' [[Wikipedia:Banning policy|banned users]]' -- .. ' from editing it.', -- tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from' -- .. ' editing it', --}, template = { description = '[[Wikipedia:影響が特に大きいテンプレート|' .. '影響が特に大きいテンプレート・モジュール]]', text = 'この[[Wikipedia:影響が特に大きいテンプレート|' .. '影響が特に大きい${PAGETYPE}]]は、[[Wikipedia:荒らし|荒らし]]を予防するために' .. '${PROTECTIONLEVEL}されています。', explanation = function (protectionObj, args) if protectionObj.level == 'sysop' then return '詳しくは[[Wikipedia:保護の方針#半永久的な保護|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '変更が必要なときは${TALKPAGE}で議論し、[[Wikipedia:合意形成|合意形成]]後に' .. '[[Wikipedia:管理者伝言板/保護ページ編集|保護編集依頼]]を行ってください。' elseif protectionObj.level == 'extendedconfirmed' then return '詳しくは[[Wikipedia:拡張半保護の方針#半永久的な拡張半保護|拡張半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. 'この${PAGETYPE}を編集することができない場合、${TALKPAGE}にて' .. '<code class="nowrap">{{[[Template:拡張半保護編集依頼|拡張半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:拡張半保護の方針#拡張半保護されたページの編集|編集を依頼]]するか、' .. '[[Wikipedia:管理者伝言板/拡張承認の申請|拡張承認の申請]]をしてください。' else return '詳しくは[[Wikipedia:半保護の方針#半永久的な半保護|半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. 'この${PAGETYPE}を編集することができない場合、${TALKPAGE}にて' .. '<code class="nowrap">{{[[Template:半保護編集依頼|半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:半保護の方針#半保護されたページの編集|編集を依頼]]してください。' end end, tooltip = 'この影響が特に大きい${PAGETYPE}は、' .. '荒らしを予防するために${PROTECTIONLEVEL}されています。', alt = '半永久的に${PROTECTIONLEVEL}されている${PAGETYPE}', image = function (protectionObj) if protectionObj.level == 'sysop' then return 'Edit Semi-permanent Protection.svg' elseif protectionObj.level == 'extendedconfirmed' then return 'Edit Semi-permanent Extended Semi-protection.svg' else return 'Edit Semi-permanent Semi-protection.svg' end end, }, --usertalk = { -- description = 'For pages protected against disruptive edits by a' -- .. ' particular user', -- text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,' -- .. ' such as abusing the' -- .. ' &#123;&#123;[[Template:unblock|unblock]]&#125;&#125; template.', -- explanation = 'If you cannot edit this user talk page and you need to' -- .. ' make a change or leave a message, you can' -- .. ' [[Wikipedia:Requests for page protection' -- .. '#Current requests for edits to a protected page' -- .. '|request an edit]],' -- .. ' [[Wikipedia:Requests for page protection' -- .. '#Current requests for reduction in protection level' -- .. '|request unprotection]],' -- .. ' [[Special:Userlogin|log in]],' -- .. ' or [[Special:UserLogin/signup|create an account]].', --}, vandalism = { description = '[[Wikipedia:荒らし|荒らし]]行為により保護されたページ', text = '度重なる[[Wikipedia:荒らし|荒らし]]行為のため、${INTROBLURB}', tooltip = '度重なる荒らし行為のため、${TOOLTIPBLURB}' } }, move = { dispute = { description = '[[Wikipedia:編集合戦#移動合戦|移動合戦]]により保護されたページ', text = '[[Wikipedia:編集合戦#移動合戦|移動合戦]]が発生したため、${INTROFRAGMENT}', explanation = "${CURRENTVERSION}が'''適切とは限りません'''。" .. '詳しくは[[Wikipedia:保護の方針|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. 'ページ名について意見がある場合は${TALKPAGE}で議論し、' .. '必要に応じて[[Wikipedia:ページの改名]]に従い、' .. '[[Wikipedia:改名提案|改名の提案]]をしてください。' .. '[[Wikipedia:合意形成|合意が形成]]され、保護を解除できる状態になった場合は' .. '[[Wikipedia:保護解除依頼|保護の解除を依頼]]してください。', tooltip = '移動合戦が発生したため、${TOOLTIPBLURB}', }, vandalism = { description = '[[Wikipedia:荒らし#移動荒らし|移動荒らし]]行為により保護されたページ', text = '度重なる[[Wikipedia:荒らし#移動荒らし|移動荒らし]]行為のため、${INTROFRAGMENT}', tooltip = '度重なる移動荒らし行為のため、${TOOLTIPBLURB}' } }, autoreview = {}, upload = {} }, -------------------------------------------------------------------------------- -- -- GENERAL DATA TABLES -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Protection blurbs -------------------------------------------------------------------------------- -- This table produces the protection blurbs available with the -- ${PROTECTIONBLURB} parameter. It is sorted by protection action and -- protection level, and is checked by the module in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. protectionBlurbs = { edit = { default = 'この${PAGETYPE}は編集[[Wikipedia:保護|保護]]されています', autoconfirmed = 'この${PAGETYPE}は[[Wikipedia:利用者#新規利用者|新規利用者]]' .. 'および[[Wikipedia:利用者#IP利用者|未登録利用者]]からの編集を[[Wikipedia:保護|禁止]]しています', extendedconfirmed = 'この${PAGETYPE}は[[Wikipedia:利用者#拡張承認された利用者|' .. '拡張承認された利用者]]以外の編集を[[Wikipedia:保護|禁止]]しています', }, move = { default = 'この${PAGETYPE}は[[Help:ページの移動|移動]][[Wikipedia:保護|保護]]されています', extendedconfirmed = 'この${PAGETYPE}は[[Wikipedia:利用者#拡張承認された利用者|' .. '拡張承認された利用者]]以外の[[Help:ページの移動|移動]]を[[Wikipedia:保護|禁止]]しています', }, autoreview = { default = 'All edits made to this ${PAGETYPE} by' .. ' [[Wikipedia:User access levels#New users|new]] or' .. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]' .. ' users are currently' .. ' [[Wikipedia:Pending changes|subject to review]]' }, upload = { default = 'この${PAGETYPE}は[[Wikipedia:ファイルのアップロード|アップロード]]' .. '[[Wikipedia:保護|保護]]されています', extendedconfirmed = 'この${PAGETYPE}は[[Wikipedia:利用者#拡張承認された利用者|' .. '拡張承認された利用者]]以外の[[Wikipedia:ファイルのアップロード|アップロード]]を' .. '[[Wikipedia:保護|禁止]]しています', } }, -------------------------------------------------------------------------------- -- Explanation blurbs -------------------------------------------------------------------------------- -- This table produces the explanation blurbs available with the -- ${EXPLANATIONBLURB} parameter. It is sorted by protection action, -- protection level, and whether the page is a talk page or not. If the page is -- a talk page it will have a talk key of "talk"; otherwise it will have a talk -- key of "subject". The table is checked in the following order: -- 1. page's protection action, page's protection level, page's talk key -- 2. page's protection action, page's protection level, default talk key -- 3. page's protection action, default protection level, page's talk key -- 4. page's protection action, default protection level, default talk key -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. explanationBlurbs = { edit = { autoconfirmed = { subject = '詳しくは[[Wikipedia:半保護の方針|半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。この${PAGETYPE}を編集することができない場合、${TALKPAGE}' .. 'にて<code class="nowrap">{{[[Template:半保護編集依頼|半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:半保護の方針#半保護されたページの編集|編集を依頼]]してください。' .. '半保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|半保護の解除を依頼]]してください。', default = '詳しくは[[Wikipedia:半保護の方針|半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '半保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|半保護の解除を依頼]]してください。', }, extendedconfirmed = { subject = '詳しくは[[Wikipedia:拡張半保護の方針|拡張半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。この${PAGETYPE}を編集することができない場合、${TALKPAGE}' .. 'にて<code class="nowrap">{{[[Template:拡張半保護編集依頼|拡張半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:拡張半保護の方針#拡張半保護されたページの編集|編集を依頼]]するか、' .. '[[Wikipedia:管理者伝言板/拡張承認の申請|拡張承認の申請]]を' .. 'してください。拡張半保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|拡張半保護の解除を依頼]]してください。', default = '詳しくは[[Wikipedia:拡張半保護の方針|拡張半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '拡張半保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|拡張半保護の解除を依頼]]してください。' }, default = { subject = '詳しくは[[Wikipedia:保護の方針|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '変更が必要なときは${TALKPAGE}で議論し、[[Wikipedia:合意形成|合意形成]]後に' .. '[[Wikipedia:管理者伝言板/保護ページ編集|保護編集依頼]]を行ってください。' .. '合意が形成されるなど、保護を解除できる状態になった場合は' .. '[[Wikipedia:保護解除依頼|保護の解除を依頼]]してください。', default = '詳しくは[[Wikipedia:保護の方針|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '合意が形成されるなど、保護を解除できる状態になった場合は' .. '[[Wikipedia:保護解除依頼|保護の解除を依頼]]してください。' } }, move = { extendedconfirmed = { subject = '詳しくは[[Wikipedia:拡張半保護の方針|拡張半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. 'ページを移動できない場合は、${TALKPAGE}にて' .. '<code class="nowrap">{{[[Template:拡張半保護編集依頼|拡張半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:拡張半保護の方針#拡張半保護されたページの編集|移動を依頼]]するか、' .. '[[Wikipedia:管理者伝言板/拡張承認の申請|拡張承認の申請]]を' .. 'してください。移動拡張半保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|移動拡張半保護の解除を依頼]]してください。', default = '詳しくは[[Wikipedia:拡張半保護の方針|拡張半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '移動拡張半保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|移動拡張半保護の解除を依頼]]してください。' }, default = { subject = '詳しくは[[Wikipedia:保護の方針|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '移動が必要なときは${TALKPAGE}で議論し、' .. '[[Wikipedia:合意形成|合意形成]]後に' .. '[[Wikipedia:移動依頼|移動依頼]]で依頼してください。' .. '合意が形成されるなど、移動保護を解除できる状態になった場合は' .. '[[Wikipedia:保護解除依頼|移動保護の解除を依頼]]してください。', default = '詳しくは[[Wikipedia:保護の方針|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '合意が形成されるなど、移動保護を解除できる状態になった場合は' .. '[[Wikipedia:保護解除依頼|移動保護の解除を依頼]]してください。' } }, autoreview = { default = { default = 'See the [[Wikipedia:Protection policy|' .. 'protection policy]] and ${PROTECTIONLOG} for more details.' .. ' Edits to this ${PAGETYPE} by new and unregistered users' .. ' will not be visible to readers until they are accepted by' .. ' a reviewer. To avoid the need for your edits to be' .. ' reviewed, you may' .. ' [[Wikipedia:Requests for page protection' .. '#Current requests for reduction in protection level' .. '|request unprotection]], [[Special:Userlogin|log in]], or' .. ' [[Special:UserLogin/signup|create an account]].' }, }, upload = { default = { default = '詳しくは${PROTECTIONLOG}をご覧ください。' .. '編集保護されていない場合は、' .. 'ファイルの説明を編集することができます。' .. 'アップロード保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|アップロード保護の解除を依頼]]してください。' } } }, -------------------------------------------------------------------------------- -- Protection levels -------------------------------------------------------------------------------- -- This table provides the data for the ${PROTECTIONLEVEL} parameter, which -- produces a short label for different protection levels. It is sorted by -- protection action and protection level, and is checked in the following -- order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. protectionLevels = { edit = { default = '保護', templateeditor = 'template-protected', extendedconfirmed = '拡張半保護', autoconfirmed = '半保護', }, move = { default = '移動保護', extendedconfirmed = '移動拡張半保護' }, autoreview = { }, upload = { default = 'アップロード保護', extendedconfirmed = 'アップロード拡張半保護' } }, -------------------------------------------------------------------------------- -- Images -------------------------------------------------------------------------------- -- This table lists different padlock images for each protection action and -- protection level. It is used if an image is not specified in any of the -- banner data tables, and if the page does not satisfy the conditions for using -- the ['image-filename-indef'] image. It is checked in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level images = { edit = { default = 'Edit Protection.svg', templateeditor = 'Template-protection-shackle.svg', extendedconfirmed = 'Edit Extended Semi-protection.svg', autoconfirmed = 'Edit Semi-protection.svg' }, move = { default = 'Move-protection-shackle.svg', extendedconfirmed = 'Move Extended Semi-protection.svg', }, autoreview = { default = 'Pending-protection-shackle.svg' }, upload = { default = 'Upload Protection.svg', extendedconfirmed = 'Upload Extended Semi-protection.svg', } }, -- Pages with a reason specified in this table will show the special "indef" -- padlock, defined in the 'image-filename-indef' message, if no expiry is set. indefImageReasons = { template = true }, -------------------------------------------------------------------------------- -- Image links -------------------------------------------------------------------------------- -- This table provides the data for the ${IMAGELINK} parameter, which gets -- the image link for small padlock icons based on the page's protection action -- and protection level. It is checked in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. imageLinks = { edit = { default = 'Wikipedia:保護の方針', templateeditor = 'Wikipedia:Protection policy#template', extendedconfirmed = 'Wikipedia:拡張半保護の方針', autoconfirmed = 'Wikipedia:半保護の方針' }, move = { default = 'Wikipedia:保護の方針', extendedconfirmed = 'Wikipedia:拡張半保護の方針' }, autoreview = { default = 'Wikipedia:Protection policy#pending' }, upload = { default = '' } }, -------------------------------------------------------------------------------- -- Padlock indicator names -------------------------------------------------------------------------------- -- This table provides the "name" attribute for the <indicator> extension tag -- with which small padlock icons are generated. All indicator tags on a page -- are displayed in alphabetical order based on this attribute, and with -- indicator tags with duplicate names, the last tag on the page wins. -- The attribute is chosen based on the protection action; table keys must be a -- protection action name or the string "default". padlockIndicatorNames = { move = 'pp-move', autoreview = 'pp-autoreview', upload = 'pp-upload', default = 'pp-default' }, -------------------------------------------------------------------------------- -- Protection categories -------------------------------------------------------------------------------- --[[ -- The protection categories are stored in the protectionCategories table. -- Keys to this table are made up of the following strings: -- -- 1. the expiry date -- 2. the namespace -- 3. the protection reason (e.g. "dispute" or "vandalism") -- 4. the protection level (e.g. "sysop" or "autoconfirmed") -- 5. the action (e.g. "edit" or "move") -- -- When the module looks up a category in the table, first it will will check to -- see a key exists that corresponds to all five parameters. For example, a -- user page semi-protected from vandalism for two weeks would have the key -- "temp-user-vandalism-autoconfirmed-edit". If no match is found, the module -- changes the first part of the key to "all" and checks the table again. It -- keeps checking increasingly generic key combinations until it finds the -- field, or until it reaches the key "all-all-all-all-all". -- -- The module uses a binary matrix to determine the order in which to search. -- This is best demonstrated by a table. In this table, the "0" values -- represent "all", and the "1" values represent the original data (e.g. -- "indef" or "file" or "vandalism"). -- -- expiry namespace reason level action -- order -- 1 1 1 1 1 1 -- 2 0 1 1 1 1 -- 3 1 0 1 1 1 -- 4 0 0 1 1 1 -- 5 1 1 0 1 1 -- 6 0 1 0 1 1 -- 7 1 0 0 1 1 -- 8 0 0 0 1 1 -- 9 1 1 1 0 1 -- 10 0 1 1 0 1 -- 11 1 0 1 0 1 -- 12 0 0 1 0 1 -- 13 1 1 0 0 1 -- 14 0 1 0 0 1 -- 15 1 0 0 0 1 -- 16 0 0 0 0 1 -- 17 1 1 1 1 0 -- 18 0 1 1 1 0 -- 19 1 0 1 1 0 -- 20 0 0 1 1 0 -- 21 1 1 0 1 0 -- 22 0 1 0 1 0 -- 23 1 0 0 1 0 -- 24 0 0 0 1 0 -- 25 1 1 1 0 0 -- 26 0 1 1 0 0 -- 27 1 0 1 0 0 -- 28 0 0 1 0 0 -- 29 1 1 0 0 0 -- 30 0 1 0 0 0 -- 31 1 0 0 0 0 -- 32 0 0 0 0 0 -- -- In this scheme the action has the highest priority, as it is the last -- to change, and the expiry has the least priority, as it changes the most. -- The priorities of the expiry, the protection level and the action are -- fixed, but the priorities of the reason and the namespace can be swapped -- through the use of the cfg.bannerDataNamespaceHasPriority table. --]] -- If the reason specified to the template is listed in this table, -- namespace data will take priority over reason data in the protectionCategories -- table. reasonsWithNamespacePriority = { vandalism = true, }, -- The string to use as a namespace key for the protectionCategories table for each -- namespace number. categoryNamespaceKeys = { [ 2] = 'user', [ 3] = 'user', [ 4] = 'project', [ 6] = 'file', [ 8] = 'mediawiki', [ 10] = 'template', [ 12] = 'project', [ 14] = 'category', [100] = 'portal', [828] = 'module', }, protectionCategories = { ['all|all|all|all|all'] = '編集保護中のページ', --['all|all|office|all|all'] = 'Wikipedia Office-protected pages', --['all|all|reset|all|all'] = 'Wikipedia Office-protected pages', --['all|all|dmca|all|all'] = 'Wikipedia Office-protected pages', ['all|all|permanent|all|all'] = '保護運用中のページ', --['all|all|mainpage|all|all'] = 'Wikipedia fully-protected main page files', --['all|all|ecp|extendedconfirmed|all'] = '編集拡張半保護中のページ', ['all|all|all|extendedconfirmed|edit'] = '編集拡張半保護中のページ', ['all|all|all|autoconfirmed|edit'] = '編集半保護中のページ', --['indef|all|all|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected pages', --['all|all|blp|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected biographies of living people', --['temp|all|blp|autoconfirmed|edit'] = 'Wikipedia temporarily semi-protected biographies of living people', --['all|all|dispute|autoconfirmed|edit'] = 'Wikipedia pages semi-protected due to dispute', --['all|all|sock|autoconfirmed|edit'] = 'Wikipedia pages semi-protected from banned users', --['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism', --['all|category|all|autoconfirmed|edit'] = 'Wikipedia semi-protected categories', --['all|file|all|autoconfirmed|edit'] = 'Wikipedia semi-protected files', --['all|portal|all|autoconfirmed|edit'] = 'Wikipedia semi-protected portals', --['all|project|all|autoconfirmed|edit'] = 'Wikipedia semi-protected project pages', --['all|talk|all|autoconfirmed|edit'] = 'Wikipedia semi-protected talk pages', ['all|template|all|sysop|edit'] = '編集保護中のテンプレート', ['all|template|all|autoconfirmed|edit'] = '編集半保護中のテンプレート', --['all|user|all|autoconfirmed|edit'] = 'Wikipedia semi-protected user and user talk pages', --['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates', --['all|all|blp|sysop|edit'] = 'Wikipedia indefinitely protected biographies of living people', --['temp|all|blp|sysop|edit'] = 'Wikipedia temporarily protected biographies of living people', --['all|all|dispute|sysop|edit'] = 'Wikipedia pages protected due to dispute', --['all|all|sock|sysop|edit'] = 'Wikipedia pages protected from banned users', --['all|all|vandalism|sysop|edit'] = 'Wikipedia pages protected against vandalism', --['all|category|all|sysop|edit'] = 'Wikipedia fully protected categories', --['all|file|all|sysop|edit'] = 'Wikipedia fully-protected files', --['all|project|all|sysop|edit'] = 'Wikipedia fully-protected project pages', --['all|talk|all|sysop|edit'] = 'Wikipedia fully-protected talk pages', --['all|user|all|sysop|edit'] = 'Wikipedia fully protected user and user talk pages', ['all|module|all|sysop|edit'] = '編集保護中のモジュール', --['all|module|all|templateeditor|edit'] = 'Wikipedia template-protected modules', ['all|module|all|autoconfirmed|edit'] = '編集半保護中のモジュール', ['all|all|all|sysop|move'] = '移動保護中のページ', ['all|all|all|extendedconfirmed|move'] = '移動拡張半保護中のページ', --['indef|all|all|sysop|move'] = 'Wikipedia indefinitely move-protected pages', --['all|all|dispute|sysop|move'] = 'Wikipedia pages move-protected due to dispute', --['all|all|vandalism|sysop|move'] = 'Wikipedia pages move-protected due to vandalism', --['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals', --['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals', --['all|project|all|sysop|move'] = 'Wikipedia move-protected project pages', --['all|talk|all|sysop|move'] = 'Wikipedia move-protected talk pages', ['all|template|all|sysop|move'] = '移動保護中のテンプレート', --['all|user|all|sysop|move'] = 'Wikipedia move-protected user and user talk pages', --['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages', ['all|file|all|all|upload'] = 'アップロード保護中のファイル', ['all|file|all|extendedconfirmed|upload']= 'アップロード拡張半保護中のファイル', }, -------------------------------------------------------------------------------- -- Expiry category config -------------------------------------------------------------------------------- -- This table configures the expiry category behaviour for each protection -- action. -- * If set to true, setting that action will always categorise the page if -- an expiry parameter is not set. -- * If set to false, setting that action will never categorise the page. -- * If set to nil, the module will categorise the page if: -- 1) an expiry parameter is not set, and -- 2) a reason is provided, and -- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck -- table. expiryCheckActions = { edit = nil, move = false, autoreview = true, upload = false }, reasonsWithoutExpiryCheck = { blp = true, template = true, }, -------------------------------------------------------------------------------- -- Pagetypes -------------------------------------------------------------------------------- -- This table produces the page types available with the ${PAGETYPE} parameter. -- Keys are namespace numbers, or the string "default" for the default value. pagetypes = { -- [0] = '記事', [6] = 'ファイル', [10] = 'テンプレート', [14] = 'カテゴリ', [828] = 'モジュール', [1] = 'ノートページ', [3] = '会話ページ', [5] = 'ノートページ', [7] = 'ノートページ', [9] = 'ノートページ', [11] = 'ノートページ', [13] = 'ノートページ', [15] = 'ノートページ', [101] = 'ノートページ', [103] = 'ノートページ', [829] = 'ノートページ', [2301] = 'ノートページ', [2303] = 'ノートページ', default = 'ページ' }, -------------------------------------------------------------------------------- -- Strings marking indefinite protection -------------------------------------------------------------------------------- -- This table contains values passed to the expiry parameter that mean the page -- is protected indefinitely. indefStrings = { ['indef'] = true, ['indefinite'] = true, ['indefinitely'] = true, ['infinite'] = true, }, -------------------------------------------------------------------------------- -- Group hierarchy -------------------------------------------------------------------------------- -- This table maps each group to all groups that have a superset of the original -- group's page editing permissions. hierarchy = { sysop = {}, eliminator = {'sysop'}, reviewer = {'sysop'}, filemover = {'sysop'}, templateeditor = {'sysop'}, extendedconfirmed = {'sysop'}, autoconfirmed = {'eliminator', 'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'}, user = {'autoconfirmed'}, ['*'] = {'user'} }, -------------------------------------------------------------------------------- -- Wrapper templates and their default arguments -------------------------------------------------------------------------------- -- This table contains wrapper templates used with the module, and their -- default arguments. Templates specified in this table should contain the -- following invocation, and no other template content: -- -- {{#invoke:Protection banner|main}} -- -- If other content is desired, it can be added between -- <noinclude>...</noinclude> tags. -- -- When a user calls one of these wrapper templates, they will use the -- default arguments automatically. However, users can override any of the -- arguments. wrappers = { ['Template:Pp'] = {}, ['Template:Pp-extended'] = {'ecp'}, ['Template:Pp-blp'] = {'blp'}, -- we don't need Template:Pp-create ['Template:Pp-dispute'] = {'dispute'}, ['Template:Pp-main-page'] = {'mainpage'}, ['Template:Pp-move'] = {action = 'move'}, ['Template:Pp-move-dispute'] = {'dispute', action = 'move'}, -- we don't need Template:Pp-move-indef ['Template:Pp-move-vandalism'] = {'vandalism', action = 'move'}, ['Template:Pp-office'] = {'office'}, ['Template:Pp-office-dmca'] = {'dmca'}, ['Template:Pp-pc'] = {action = 'autoreview', small = true}, ['Template:Pp-pc1'] = {action = 'autoreview', small = true}, ['Template:保護運用'] = {'permanent', small = true}, ['Template:Pp-reset'] = {'reset'}, ['Template:Pp-semi-indef'] = {small = true}, ['Template:Pp-sock'] = {'sock'}, ['Template:Pp-template'] = {'template', small = true}, ['Template:Pp-upload'] = {action = 'upload'}, ['Template:Pp-usertalk'] = {'usertalk'}, ['Template:Pp-vandalism'] = {'vandalism'}, }, -------------------------------------------------------------------------------- -- -- MESSAGES -- -------------------------------------------------------------------------------- msg = { -------------------------------------------------------------------------------- -- Intro blurb and intro fragment -------------------------------------------------------------------------------- -- These messages specify what is produced by the ${INTROBLURB} and -- ${INTROFRAGMENT} parameters. If the protection is temporary they use the -- intro-blurb-expiry or intro-fragment-expiry, and if not they use -- intro-blurb-noexpiry or intro-fragment-noexpiry. -- It is possible to use banner parameters in these messages. ['intro-blurb-expiry'] = '${PROTECTIONBLURB}(${EXPIRY}まで)。', ['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}。', ['intro-fragment-expiry'] = '${PROTECTIONBLURB}(${EXPIRY}まで)。', ['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}。', -------------------------------------------------------------------------------- -- Tooltip blurb -------------------------------------------------------------------------------- -- These messages specify what is produced by the ${TOOLTIPBLURB} parameter. -- If the protection is temporary the tooltip-blurb-expiry message is used, and -- if not the tooltip-blurb-noexpiry message is used. -- It is possible to use banner parameters in these messages. ['tooltip-blurb-expiry'] = 'この${PAGETYPE}は${EXPIRY}まで${PROTECTIONLEVEL}されています。', ['tooltip-blurb-noexpiry'] = 'この${PAGETYPE}は${PROTECTIONLEVEL}されています。', ['tooltip-fragment-expiry'] = 'この${PAGETYPE}は${EXPIRY}まで${PROTECTIONLEVEL}されており、', ['tooltip-fragment-noexpiry'] = 'この${PAGETYPE}は${PROTECTIONLEVEL}されており、', -------------------------------------------------------------------------------- -- Special explanation blurb -------------------------------------------------------------------------------- -- An explanation blurb for pages that cannot be unprotected, e.g. for pages -- in the MediaWiki namespace. -- It is possible to use banner parameters in this message. ['explanation-blurb-nounprotect'] = 'See the [[Wikipedia:Protection policy|' .. 'protection policy]] and ${PROTECTIONLOG} for more details.' .. ' Please discuss any changes on the ${TALKPAGE}; you' .. ' may ${EDITREQUEST} to ask an' .. ' [[Wikipedia:Administrators|administrator]] to make an edit if it' .. ' is [[Help:Minor edit#When to mark an edit as a minor edit' .. '|uncontroversial]] or supported by [[Wikipedia:Consensus' .. '|consensus]].', -------------------------------------------------------------------------------- -- Protection log display values -------------------------------------------------------------------------------- -- These messages determine the display values for the protection log link -- or the pending changes log link produced by the ${PROTECTIONLOG} parameter. -- It is possible to use banner parameters in these messages. ['protection-log-display'] = '保護記録', ['pc-log-display'] = 'pending changes log', -------------------------------------------------------------------------------- -- Current version display values -------------------------------------------------------------------------------- -- These messages determine the display values for the page history link -- or the move log link produced by the ${CURRENTVERSION} parameter. -- It is possible to use banner parameters in these messages. ['current-version-move-display'] = '現在のページ名', ['current-version-edit-display'] = '現行版', -------------------------------------------------------------------------------- -- Talk page -------------------------------------------------------------------------------- -- This message determines the display value of the talk page link produced -- with the ${TALKPAGE} parameter. -- It is possible to use banner parameters in this message. ['talk-page-link-display'] = 'ノートページ', -------------------------------------------------------------------------------- -- Edit requests -------------------------------------------------------------------------------- -- This message determines the display value of the edit request link produced -- with the ${EDITREQUEST} parameter. -- It is possible to use banner parameters in this message. ['edit-request-display'] = 'submit an edit request', -------------------------------------------------------------------------------- -- Expiry date format -------------------------------------------------------------------------------- -- This is the format for the blurb expiry date. It should be valid input for -- the first parameter of the #time parser function. ['expiry-date-format'] = 'Y年Fj日" ("D") "H:i" ("e")"', -------------------------------------------------------------------------------- -- Tracking categories -------------------------------------------------------------------------------- -- These messages determine which tracking categories the module outputs. ['tracking-category-incorrect'] = '不適切な保護テンプレートのあるページ', ['tracking-category-mismatch'] = '保護理由と保護レベルが合致していないページ', -- 日本語版独自 ['tracking-category-template'] = 'Wikipedia template-protected pages other than templates and modules', -------------------------------------------------------------------------------- -- Images -------------------------------------------------------------------------------- -- These are images that are not defined by their protection action and protection level. ['image-filename-indef'] = 'Edit Protection.svg', ['image-filename-default'] = 'Transparent.gif', -------------------------------------------------------------------------------- -- End messages -------------------------------------------------------------------------------- } -------------------------------------------------------------------------------- -- End configuration -------------------------------------------------------------------------------- } d41b2a922176ff7bd4a5ed1b50ebde1185081c95 モジュール:Effective protection level 828 25 62 2021-10-20T11:26:00Z ja>ネイ 0 「[[モジュール:Effective protection level]]」を保護しました: [[WP:HRT|影響が特に大きいテンプレート]]: 使用数9,300 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) Scribunto text/plain local p = {} -- Returns the permission required to perform a given action on a given title. -- If no title is specified, the title of the page being displayed is used. function p._main(action, pagename) local title if type(pagename) == 'table' and pagename.prefixedText then title = pagename elseif pagename then title = mw.title.new(pagename) else title = mw.title.getCurrentTitle() end pagename = title.prefixedText if action == 'autoreview' then local level = mw.ext.FlaggedRevs.getStabilitySettings(title) level = level and level.autoreview if level == 'review' then return 'reviewer' elseif level ~= '' then return level else return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review end elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then error( '第1引数にはedit、move、create、upload、undelete、autoreviewのどれかを指定してください', 2 ) end if title.namespace == 8 then -- MediaWiki namespace if title.text:sub(-3) == '.js' or title.text:sub(-4) == '.css' or title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page return 'interfaceadmin' else -- any non-JS/CSS MediaWiki page return 'sysop' end elseif title.namespace == 2 and title.isSubpage then if title.contentModel == 'javascript' or title.contentModel == 'css' then -- user JS or CSS page return 'interfaceadmin' elseif title.contentModel == 'json' then -- user JSON page return 'sysop' end end if action == 'undelete' then return 'eliminator' -- 英語版では'sysop' end local level = title.protectionLevels[action] and title.protectionLevels[action][1] if level == 'sysop' or level == 'editprotected' then return 'sysop' elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page return 'sysop' elseif level == 'templateeditor' then return 'templateeditor' elseif action == 'move' then local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move. if blacklistentry and not blacklistentry.params.autoconfirmed then return 'templateeditor' elseif title.namespace == 6 then return 'eliminator' -- 英語版では'filemover' elseif level == 'extendedconfirmed' then return 'extendedconfirmed' else return 'autoconfirmed' end end local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename) if blacklistentry then if not blacklistentry.params.autoconfirmed then return 'sysop' -- 英語版では'templateeditor' elseif level == 'extendedconfirmed' then return 'extendedconfirmed' else return 'autoconfirmed' end elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason return 'autoconfirmed' elseif level then return level elseif action == 'upload' then return 'autoconfirmed' -- 英語版とは異なり、日本語版では現在のところIPユーザーでも記事等を作成可能なので、以下はコメントアウト -- elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts -- return 'user' else return '*' end end setmetatable(p, { __index = function(t, k) return function(frame) return t._main(k, frame.args[1]) end end }) return p 366a310b678c4d083a5cec695cdc85050a07fb04 モジュール:Effective protection expiry 828 26 64 2021-10-20T11:26:06Z ja>ネイ 0 「[[モジュール:Effective protection expiry]]」を保護しました: [[WP:HRT|影響が特に大きいテンプレート]]: 使用数9,300 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) Scribunto text/plain local p = {} -- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known. -- If no title is specified, the title of the page being displayed is used. function p._main(action, pagename) local title if type(pagename) == 'table' and pagename.prefixedText then title = pagename elseif pagename then title = mw.title.new(pagename) else title = mw.title.getCurrentTitle() end pagename = title.prefixedText if action == 'autoreview' then local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title) return stabilitySettings and stabilitySettings.expiry or 'unknown' elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then error( '第1引数にはedit、move、create、upload、autoreviewのどれかを指定してください', 2 ) end local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename) if rawExpiry == 'infinity' then return 'infinity' elseif rawExpiry == '' then return 'unknown' else local year, month, day, hour, minute, second = rawExpiry:match( '^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$' ) if year then return string.format( '%s-%s-%sT%s:%s:%s', year, month, day, hour, minute, second ) else error('[[モジュール:Effective protection expiry]]のエラー; 有効期限のタイムスタンプの書式が不正です') end end end setmetatable(p, { __index = function(t, k) return function(frame) return t._main(k, frame.args[1]) end end }) return p bd6d5cdf7fc2a720603bcbc952773bb41197c42b テンプレート:Sandbox other 10 30 72 2021-10-20T11:33:13Z ja>ネイ 0 「[[Template:Sandbox other]]」を保護しました: [[WP:HRT|影響が特に大きいテンプレート]]: 使用数6,600 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki {{#if:{{#ifeq:{{#invoke:String|sublength|s={{SUBPAGENAME}}|i=0|len=7}}|sandbox|1}}{{#ifeq:{{SUBPAGENAME}}|doc|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}<!-- --><noinclude> {{Documentation}} </noinclude> 5e237028231c8eddac6dd278289ec8de1b654916 テンプレート:Code 10 49 110 2021-10-20T12:47:42Z ja>えのきだたもつ 0 「[[Template:Code]]」を保護しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki {{#tag:syntaxhighlight|{{{code|{{{1}}}}}}|lang={{{lang|{{{2|text}}}}}}|class={{{class|}}}|id={{{id|}}}|style={{{style|}}}|inline=1}}<noinclude> {{Documentation}}</noinclude> 828490bdc2b9805a4e417d387dd29f4383f44796 テンプレート:Greater color contrast ratio 10 65 142 2021-10-20T18:04:42Z ja>えのきだたもつ 0 「[[Template:Greater color contrast ratio]]」を保護しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki <includeonly>{{#invoke:Color contrast|greatercontrast}}</includeonly><noinclude> {{Documentation}} </noinclude> cf8f2a0c41a597f4ccd122afc981f8272233193f テンプレート:使用箇所の多いテンプレート 10 43 98 2021-10-24T16:59:32Z ja>えのきだたもつ 0 「[[Template:使用箇所の多いテンプレート]]」の保護設定を変更しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=自動承認された利用者のみ許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki {{ombox | type = content | text = '''この{{ #switch:{{NAMESPACE}} |モジュール=Luaモジュール |#default=テンプレート }}は<span class="plainlinks">[https://templatecount.toolforge.org/index.php?lang=ja&namespace={{NAMESPACENUMBER:{{FULLPAGENAME}}}}&name={{PAGENAMEE}} {{#if:{{{1|}}}|{{{1}}}|多く}}のページ]で使われています。</span>'''<br />余計な混乱やサーバーへの負荷を避けるために、どんな変更でも最初は{{ #switch:{{NAMESPACE}} |モジュール=モジュール |#default=テンプレート }}の[[{{ #switch: {{SUBPAGENAME}} | doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}} | #default = {{SUBJECTPAGENAME}} }}/sandbox|サンドボックス・サブページ]]、[[{{ #switch: {{SUBPAGENAME}} | doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}} | #default = {{SUBJECTPAGENAME}} }}/testcases|テストケース・サブページ]]{{ #switch:{{NAMESPACE}} |モジュール= |#default=もしくはあなた自身の[[Wikipedia:利用者ページ|利用者スペース]]の[[特別:Mypage/sandbox|ページ]] }}で試すべきです。そうすれば、試した変更を1度の編集でこの{{ #switch:{{NAMESPACE}} |モジュール=モジュール |#default=テンプレート }}に加えることができます。しかし、最初にあなたの提案した変更を、{{#if:{{{2|}}}|[[{{{2}}}]]|[[{{ #switch: {{SUBPAGENAME}} | doc | sandbox = {{TALKSPACE}}:{{BASEPAGENAME}} | #default = {{TALKPAGENAME}} }}|この項目のノート]]}}で議論するようにお願いします。 }}<noinclude> {{Documentation}} <!-- カテゴリはここではなく/doc サブページに、言語間リンクはウィキデータ加えてください--> </noinclude> a148907663479c156929b264632034280e8da800 モジュール:Documentation 828 33 78 2021-10-28T10:33:02Z ja>本日晴天 0 コメントを修正 Scribunto text/plain -- This module implements {{documentation}}. -- Get required modules. local getArgs = require('Module:Arguments').getArgs local messageBox = require('Module:Message box') -- Get the config table. local cfg = mw.loadData('Module:Documentation/config') local p = {} -- Often-used functions. local ugsub = mw.ustring.gsub ---------------------------------------------------------------------------- -- Helper functions -- -- These are defined as local functions, but are made available in the p -- table for testing purposes. ---------------------------------------------------------------------------- local function message(cfgKey, valArray, expectType) --[[ -- Gets a message from the cfg table and formats it if appropriate. -- The function raises an error if the value from the cfg table is not -- of the type expectType. The default type for expectType is 'string'. -- If the table valArray is present, strings such as $1, $2 etc. in the -- message are substituted with values from the table keys [1], [2] etc. -- For example, if the message "foo-message" had the value 'Foo $2 bar $1.', -- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz." --]] local msg = cfg[cfgKey] expectType = expectType or 'string' if type(msg) ~= expectType then error('メッセージ: cfg.' .. cfgKey .. 'の入力エラー。(想定:' .. expectType .. '、実際:' .. type(msg) .. ')', 2) end if not valArray then return msg end local function getMessageVal(match) match = tonumber(match) return valArray[match] or error('メッセージ: メッセージ設定で$' .. match .. 'キーの値が見つかりませんでした。' .. cfgKey, 4) end return ugsub(msg, '$([1-9][0-9]*)', getMessageVal) end p.message = message local function makeWikilink(page, display) if display then return mw.ustring.format('[[%s|%s]]', page, display) else return mw.ustring.format('[[%s]]', page) end end p.makeWikilink = makeWikilink local function makeCategoryLink(cat, sort) local catns = mw.site.namespaces[14].name return makeWikilink(catns .. ':' .. cat, sort) end p.makeCategoryLink = makeCategoryLink local function makeUrlLink(url, display) return mw.ustring.format('[%s %s]', url, display) end p.makeUrlLink = makeUrlLink local function makeToolbar(...) local ret = {} local lim = select('#', ...) if lim < 1 then return nil end for i = 1, lim do ret[#ret + 1] = select(i, ...) end -- 'documentation-toolbar' return '<span class="' .. message('toolbar-class') .. '">(' .. table.concat(ret, ' &#124; ') .. ')</span>' end p.makeToolbar = makeToolbar ---------------------------------------------------------------------------- -- Argument processing ---------------------------------------------------------------------------- local function makeInvokeFunc(funcName) return function (frame) local args = getArgs(frame, { valueFunc = function (key, value) if type(value) == 'string' then value = value:match('^%s*(.-)%s*$') -- Remove whitespace. if key == 'heading' or value ~= '' then return value else return nil end else return value end end }) return p[funcName](args) end end ---------------------------------------------------------------------------- -- Entry points ---------------------------------------------------------------------------- function p.nonexistent(frame) if mw.title.getCurrentTitle().subpageText == 'testcases' then return frame:expandTemplate{title = 'module test cases notice'} else return p.main(frame) end end p.main = makeInvokeFunc('_main') function p._main(args) --[[ -- This function defines logic flow for the module. -- @args - table of arguments passed by the user --]] local env = p.getEnvironment(args) local root = mw.html.create() root :wikitext(p._getModuleWikitext(args, env)) :wikitext(p.protectionTemplate(env)) :wikitext(p.sandboxNotice(args, env)) :tag('div') -- 'documentation-container' :addClass(message('container')) :newline() :tag('div') -- 'documentation' :addClass(message('main-div-classes')) :newline() :wikitext(p._startBox(args, env)) :wikitext(p._content(args, env)) :tag('div') -- 'documentation-clear' :addClass(message('clear')) :done() :newline() :done() :wikitext(p._endBox(args, env)) :done() :wikitext(p.addTrackingCategories(env)) -- 'Module:Documentation/styles.css' return mw.getCurrentFrame():extensionTag ( 'templatestyles', '', {src=cfg['templatestyles'] }) .. tostring(root) end ---------------------------------------------------------------------------- -- Environment settings ---------------------------------------------------------------------------- function p.getEnvironment(args) --[[ -- Returns a table with information about the environment, including title -- objects and other namespace- or path-related data. -- @args - table of arguments passed by the user -- -- Title objects include: -- env.title - the page we are making documentation for (usually the current title) -- env.templateTitle - the template (or module, file, etc.) -- env.docTitle - the /doc subpage. -- env.sandboxTitle - the /sandbox subpage. -- env.testcasesTitle - the /testcases subpage. -- env.printTitle - the print version of the template, located at the /Print subpage. -- -- Data includes: -- env.protectionLevels - the protection levels table of the title object. -- env.subjectSpace - the number of the title's subject namespace. -- env.docSpace - the number of the namespace the title puts its documentation in. -- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace. -- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template. -- -- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value -- returned will be nil. --]] local env, envFuncs = {}, {} -- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value -- returned by that function is memoized in the env table so that we don't call any of the functions -- more than once. (Nils won't be memoized.) setmetatable(env, { __index = function (t, key) local envFunc = envFuncs[key] if envFunc then local success, val = pcall(envFunc) if success then env[key] = val -- Memoise the value. return val end end return nil end }) function envFuncs.title() -- The title object for the current page, or a test page passed with args.page. local title local titleArg = args.page if titleArg then title = mw.title.new(titleArg) else title = mw.title.getCurrentTitle() end return title end function envFuncs.templateTitle() --[[ -- The template (or module, etc.) title object. -- Messages: -- 'sandbox-subpage' --> 'sandbox' -- 'testcases-subpage' --> 'testcases' --]] local subjectSpace = env.subjectSpace local title = env.title local subpage = title.subpageText if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then return mw.title.makeTitle(subjectSpace, title.baseText) else return mw.title.makeTitle(subjectSpace, title.text) end end function envFuncs.docTitle() --[[ -- Title object of the /doc subpage. -- Messages: -- 'doc-subpage' --> 'doc' --]] local title = env.title local docname = args[1] -- User-specified doc page. local docpage if docname then docpage = docname else docpage = env.docpageBase .. '/' .. message('doc-subpage') end return mw.title.new(docpage) end function envFuncs.sandboxTitle() --[[ -- Title object for the /sandbox subpage. -- Messages: -- 'sandbox-subpage' --> 'sandbox' --]] return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage')) end function envFuncs.testcasesTitle() --[[ -- Title object for the /testcases subpage. -- Messages: -- 'testcases-subpage' --> 'testcases' --]] return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage')) end function envFuncs.printTitle() --[[ -- Title object for the /Print subpage. -- Messages: -- 'print-subpage' --> 'Print' --]] return env.templateTitle:subPageTitle(message('print-subpage')) end function envFuncs.protectionLevels() -- The protection levels table of the title object. return env.title.protectionLevels end function envFuncs.subjectSpace() -- The subject namespace number. return mw.site.namespaces[env.title.namespace].subject.id end function envFuncs.docSpace() -- The documentation namespace number. For most namespaces this is the -- same as the subject namespace. However, pages in the Article, File, -- MediaWiki or Category namespaces must have their /doc, /sandbox and -- /testcases pages in talk space. local subjectSpace = env.subjectSpace if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then return subjectSpace + 1 else return subjectSpace end end function envFuncs.docpageBase() -- The base page of the /doc, /sandbox, and /testcases subpages. -- For some namespaces this is the talk page, rather than the template page. local templateTitle = env.templateTitle local docSpace = env.docSpace local docSpaceText = mw.site.namespaces[docSpace].name -- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon. return docSpaceText .. ':' .. templateTitle.text end function envFuncs.compareUrl() -- Diff link between the sandbox and the main template using [[Special:ComparePages]]. local templateTitle = env.templateTitle local sandboxTitle = env.sandboxTitle if templateTitle.exists and sandboxTitle.exists then local compareUrl = mw.uri.fullUrl( 'Special:ComparePages', { page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText} ) return tostring(compareUrl) else return nil end end return env end ---------------------------------------------------------------------------- -- Auxiliary templates ---------------------------------------------------------------------------- p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext') function p._getModuleWikitext(args, env) local currentTitle = mw.title.getCurrentTitle() if currentTitle.contentModel ~= 'Scribunto' then return end pcall(require, currentTitle.prefixedText) -- if it fails, we don't care local moduleWikitext = package.loaded["Module:Module wikitext"] if moduleWikitext then return moduleWikitext.main() end end function p.sandboxNotice(args, env) --[=[ -- Generates a sandbox notice for display above sandbox pages. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]' -- 'sandbox-notice-blurb' --> 'This is the $1 for $2.' -- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).' -- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page' -- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page' -- 'sandbox-notice-pagetype-other' --> 'sandbox page' -- 'sandbox-notice-compare-link-display' --> 'diff' -- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.' -- 'sandbox-notice-testcases-link-display' --> 'test cases' -- 'sandbox-category' --> 'Template sandboxes' --]=] local title = env.title local sandboxTitle = env.sandboxTitle local templateTitle = env.templateTitle local subjectSpace = env.subjectSpace if not (subjectSpace and title and sandboxTitle and templateTitle and mw.title.equals(title, sandboxTitle)) then return nil end -- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text". local omargs = {} omargs.image = message('sandbox-notice-image') -- Get the text. We start with the opening blurb, which is something like -- "This is the template sandbox for [[Template:Foo]] (diff)." local text = '' local pagetype if subjectSpace == 10 then pagetype = message('sandbox-notice-pagetype-template') elseif subjectSpace == 828 then pagetype = message('sandbox-notice-pagetype-module') else pagetype = message('sandbox-notice-pagetype-other') end local templateLink = makeWikilink(templateTitle.prefixedText) local compareUrl = env.compareUrl if compareUrl then local compareDisplay = message('sandbox-notice-compare-link-display') local compareLink = makeUrlLink(compareUrl, compareDisplay) text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink}) else text = text .. message('sandbox-notice-blurb', {pagetype, templateLink}) end -- Get the test cases page blurb if the page exists. This is something like -- "See also the companion subpage for [[Template:Foo/testcases|test cases]]." local testcasesTitle = env.testcasesTitle if testcasesTitle and testcasesTitle.exists then if testcasesTitle.contentModel == "Scribunto" then local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display') local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display') local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay) local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay) text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink}) else local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display') local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay) text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink}) end end -- Add the sandbox to the sandbox category. omargs.text = text .. makeCategoryLink(message('sandbox-category')) -- 'documentation-clear' return '<div class="' .. message('clear') .. '"></div>' .. require('Module:Message box').main('ombox', omargs) end function p.protectionTemplate(env) -- Generates the padlock icon in the top right. -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'protection-template' --> 'pp-template' -- 'protection-template-args' --> {docusage = 'yes'} local protectionLevels = env.protectionLevels if not protectionLevels then return nil end local editProt = protectionLevels.edit and protectionLevels.edit[1] local moveProt = protectionLevels.move and protectionLevels.move[1] -- 日本語版独自仕様: 編集保護と移動保護で保護レベルが異なる場合に、両方のアイコンを表示する local ret = '' if editProt then -- The page is edit-protected. ret = ret .. require('Module:Protection banner')._main{ message('protection-reason-edit'), small = true } end if moveProt and moveProt ~= editProt and moveProt ~= 'autoconfirmed' then -- The page is move-protected. ret = ret .. require('Module:Protection banner')._main{ action = 'move', small = true } end return ret end ---------------------------------------------------------------------------- -- Start box ---------------------------------------------------------------------------- p.startBox = makeInvokeFunc('_startBox') function p._startBox(args, env) --[[ -- This function generates the start box. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make -- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox -- which generate the box HTML. --]] env = env or p.getEnvironment(args) local links local content = args.content if not content or args[1] then -- No need to include the links if the documentation is on the template page itself. local linksData = p.makeStartBoxLinksData(args, env) if linksData then links = p.renderStartBoxLinks(linksData) end end -- Generate the start box html. local data = p.makeStartBoxData(args, env, links) if data then return p.renderStartBox(data) else -- User specified no heading. return nil end end function p.makeStartBoxLinksData(args, env) --[[ -- Does initial processing of data to make the [view] [edit] [history] [purge] links. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'view-link-display' --> 'view' -- 'edit-link-display' --> 'edit' -- 'history-link-display' --> 'history' -- 'purge-link-display' --> 'purge' -- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace' -- 'module-preload' --> 'Template:Documentation/preload-module-doc' -- 'docpage-preload' --> 'Template:Documentation/preload' -- 'create-link-display' --> 'create' --]] local subjectSpace = env.subjectSpace local title = env.title local docTitle = env.docTitle if not title or not docTitle then return nil end if docTitle.isRedirect then docTitle = docTitle.redirectTarget end local data = {} data.title = title data.docTitle = docTitle -- View, display, edit, and purge links if /doc exists. data.viewLinkDisplay = message('view-link-display') data.editLinkDisplay = message('edit-link-display') data.historyLinkDisplay = message('history-link-display') data.purgeLinkDisplay = message('purge-link-display') -- Create link if /doc doesn't exist. local preload = args.preload if not preload then if subjectSpace == 6 then -- File namespace preload = message('file-docpage-preload') elseif subjectSpace == 828 then -- Module namespace preload = message('module-preload') else preload = message('docpage-preload') end end data.preload = preload data.createLinkDisplay = message('create-link-display') return data end function p.renderStartBoxLinks(data) --[[ -- Generates the [view][edit][history][purge] or [create] links from the data table. -- @data - a table of data generated by p.makeStartBoxLinksData --]] local function escapeBrackets(s) -- Escapes square brackets with HTML entities. s = s:gsub('%[', '&#91;') -- Replace square brackets with HTML entities. s = s:gsub('%]', '&#93;') return s end local ret local docTitle = data.docTitle local title = data.title if docTitle.exists then local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay) local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay) local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay) local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay) ret = '[%s] [%s] [%s] [%s]' ret = escapeBrackets(ret) ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink) else local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay) ret = '[%s]' ret = escapeBrackets(ret) ret = mw.ustring.format(ret, createLink) end return ret end function p.makeStartBoxData(args, env, links) --[=[ -- Does initial processing of data to pass to the start-box render function, p.renderStartBox. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error. -- -- Messages: -- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]' -- 'template-namespace-heading' --> 'Template documentation' -- 'module-namespace-heading' --> 'Module documentation' -- 'file-namespace-heading' --> 'Summary' -- 'other-namespaces-heading' --> 'Documentation' -- 'testcases-create-link-display' --> 'create' --]=] local subjectSpace = env.subjectSpace if not subjectSpace then -- Default to an "other namespaces" namespace, so that we get at least some output -- if an error occurs. subjectSpace = 2 end local data = {} -- Heading local heading = args.heading -- Blank values are not removed. if heading == '' then -- Don't display the start box if the heading arg is defined but blank. return nil end if heading then data.heading = heading elseif subjectSpace == 10 then -- Template namespace data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading') elseif subjectSpace == 828 then -- Module namespace data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading') elseif subjectSpace == 6 then -- File namespace data.heading = message('file-namespace-heading') else data.heading = message('other-namespaces-heading') end -- Heading CSS local headingStyle = args['heading-style'] if headingStyle then data.headingStyleText = headingStyle else -- 'documentation-heading' data.headingClass = message('main-div-heading-class') end -- Data for the [view][edit][history][purge] or [create] links. if links then -- 'mw-editsection-like plainlinks' data.linksClass = message('start-box-link-classes') data.links = links end return data end function p.renderStartBox(data) -- Renders the start box html. -- @data - a table of data generated by p.makeStartBoxData. local sbox = mw.html.create('div') sbox -- 'documentation-startbox' :addClass(message('start-box-class')) :newline() :tag('span') :addClass(data.headingClass) :cssText(data.headingStyleText) :wikitext(data.heading) local links = data.links if links then sbox:tag('span') :addClass(data.linksClass) :attr('id', data.linksId) :wikitext(links) end return tostring(sbox) end ---------------------------------------------------------------------------- -- Documentation content ---------------------------------------------------------------------------- p.content = makeInvokeFunc('_content') function p._content(args, env) -- Displays the documentation contents -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment env = env or p.getEnvironment(args) local docTitle = env.docTitle local content = args.content if not content and docTitle and docTitle.exists then content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText} end -- The line breaks below are necessary so that "=== Headings ===" at the start and end -- of docs are interpreted correctly. return '\n' .. (content or '') .. '\n' end p.contentTitle = makeInvokeFunc('_contentTitle') function p._contentTitle(args, env) env = env or p.getEnvironment(args) local docTitle = env.docTitle if not args.content and docTitle and docTitle.exists then return docTitle.prefixedText else return '' end end ---------------------------------------------------------------------------- -- End box ---------------------------------------------------------------------------- p.endBox = makeInvokeFunc('_endBox') function p._endBox(args, env) --[=[ -- This function generates the end box (also known as the link box). -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- --]=] -- Get environment data. env = env or p.getEnvironment(args) local subjectSpace = env.subjectSpace local docTitle = env.docTitle if not subjectSpace or not docTitle then return nil end -- Check whether we should output the end box at all. Add the end -- box by default if the documentation exists or if we are in the -- user, module or template namespaces. local linkBox = args['link box'] if linkBox == 'off' or not ( docTitle.exists or subjectSpace == 2 or subjectSpace == 828 or subjectSpace == 10 ) then return nil end -- Assemble the link box. local text = '' if linkBox then text = text .. linkBox else text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]." if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then -- We are in the user, template or module namespaces. -- Add sandbox and testcases links. -- "Editors can experiment in this template's sandbox and testcases pages." text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />' if not args.content and not args[1] then -- "Please add categories to the /doc subpage." -- Don't show this message with inline docs or with an explicitly specified doc page, -- as then it is unclear where to add the categories. text = text .. (p.makeCategoriesBlurb(args, env) or '') end text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template" local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates. if printBlurb then text = text .. '<br />' .. printBlurb end end end local box = mw.html.create('div') box:attr('role', 'note') -- 'documentation-metadata' :addClass(message('end-box-class')) -- 'plainlinks' :addClass(message('end-box-plainlinks')) :wikitext(text) :done() return '\n' .. tostring(box) end function p.makeDocPageBlurb(args, env) --[=[ -- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)". -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'edit-link-display' --> 'edit' -- 'history-link-display' --> 'history' -- 'transcluded-from-blurb' --> -- 'The above [[Wikipedia:Template documentation|documentation]] -- is [[Help:Transclusion|transcluded]] from $1.' -- 'module-preload' --> 'Template:Documentation/preload-module-doc' -- 'create-link-display' --> 'create' -- 'create-module-doc-blurb' --> -- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].' --]=] local docTitle = env.docTitle if not docTitle then return nil end local ret if docTitle.exists then -- /doc exists; link to it. local docLink = makeWikilink(docTitle.prefixedText) local editUrl = docTitle:fullUrl{action = 'edit'} local editDisplay = message('edit-link-display') local editLink = makeUrlLink(editUrl, editDisplay) local historyUrl = docTitle:fullUrl{action = 'history'} local historyDisplay = message('history-link-display') local historyLink = makeUrlLink(historyUrl, historyDisplay) ret = message('transcluded-from-blurb', {docLink}) .. ' ' .. makeToolbar(editLink, historyLink) .. '<br />' elseif env.subjectSpace == 828 then -- /doc does not exist; ask to create it. local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')} local createDisplay = message('create-link-display') local createLink = makeUrlLink(createUrl, createDisplay) ret = message('create-module-doc-blurb', {createLink}) .. '<br />' end return ret end function p.makeExperimentBlurb(args, env) --[[ -- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages." -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'sandbox-link-display' --> 'sandbox' -- 'sandbox-edit-link-display' --> 'edit' -- 'compare-link-display' --> 'diff' -- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox' -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox' -- 'sandbox-create-link-display' --> 'create' -- 'mirror-edit-summary' --> 'Create sandbox version of $1' -- 'mirror-link-display' --> 'mirror' -- 'mirror-link-preload' --> 'Template:Documentation/mirror' -- 'sandbox-link-display' --> 'sandbox' -- 'testcases-link-display' --> 'testcases' -- 'testcases-edit-link-display'--> 'edit' -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox' -- 'testcases-create-link-display' --> 'create' -- 'testcases-link-display' --> 'testcases' -- 'testcases-edit-link-display' --> 'edit' -- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases' -- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases' -- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.' -- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.' --]] local subjectSpace = env.subjectSpace local templateTitle = env.templateTitle local sandboxTitle = env.sandboxTitle local testcasesTitle = env.testcasesTitle local templatePage = templateTitle.prefixedText if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then return nil end -- Make links. local sandboxLinks, testcasesLinks if sandboxTitle.exists then local sandboxPage = sandboxTitle.prefixedText local sandboxDisplay = message('sandbox-link-display') local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay) local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'} local sandboxEditDisplay = message('sandbox-edit-link-display') local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay) local compareUrl = env.compareUrl local compareLink if compareUrl then local compareDisplay = message('compare-link-display') compareLink = makeUrlLink(compareUrl, compareDisplay) end sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink) else local sandboxPreload if subjectSpace == 828 then sandboxPreload = message('module-sandbox-preload') else sandboxPreload = message('template-sandbox-preload') end local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload} local sandboxCreateDisplay = message('sandbox-create-link-display') local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay) local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)}) local mirrorPreload = message('mirror-link-preload') local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary} if subjectSpace == 828 then mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary} end local mirrorDisplay = message('mirror-link-display') local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay) sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink) end if testcasesTitle.exists then local testcasesPage = testcasesTitle.prefixedText local testcasesDisplay = message('testcases-link-display') local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay) local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'} local testcasesEditDisplay = message('testcases-edit-link-display') local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay) -- for Modules, add testcases run link if exists if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then local testcasesRunLinkDisplay = message('testcases-run-link-display') local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay) testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink) else testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink) end else local testcasesPreload if subjectSpace == 828 then testcasesPreload = message('module-testcases-preload') else testcasesPreload = message('template-testcases-preload') end local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload} local testcasesCreateDisplay = message('testcases-create-link-display') local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay) testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink) end local messageName if subjectSpace == 828 then messageName = 'experiment-blurb-module' else messageName = 'experiment-blurb-template' end return message(messageName, {sandboxLinks, testcasesLinks}) end function p.makeCategoriesBlurb(args, env) --[[ -- Generates the text "Please add categories to the /doc subpage." -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'doc-link-display' --> '/doc' -- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.' --]] local docTitle = env.docTitle if not docTitle then return nil end local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display')) return message('add-categories-blurb', {docPathLink}) end function p.makeSubpagesBlurb(args, env) --[[ -- Generates the "Subpages of this template" link. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'template-pagetype' --> 'template' -- 'module-pagetype' --> 'module' -- 'default-pagetype' --> 'page' -- 'subpages-link-display' --> 'Subpages of this $1' --]] local subjectSpace = env.subjectSpace local templateTitle = env.templateTitle if not subjectSpace or not templateTitle then return nil end local pagetype if subjectSpace == 10 then pagetype = message('template-pagetype') elseif subjectSpace == 828 then pagetype = message('module-pagetype') else pagetype = message('default-pagetype') end local subpagesLink = makeWikilink( 'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/', message('subpages-link-display', {pagetype}) ) return message('subpages-blurb', {subpagesLink}) end function p.makePrintBlurb(args, env) --[=[ -- Generates the blurb displayed when there is a print version of the template available. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'print-link-display' --> '/Print' -- 'print-blurb' --> 'A [[Help:Books/for experts#Improving the book layout|print version]]' -- .. ' of this template exists at $1.' -- .. ' If you make a change to this template, please update the print version as well.' -- 'display-print-category' --> true -- 'print-category' --> 'Templates with print versions' --]=] local printTitle = env.printTitle if not printTitle then return nil end local ret if printTitle.exists then local printLink = makeWikilink(printTitle.prefixedText, message('print-link-display')) ret = message('print-blurb', {printLink}) local displayPrintCategory = message('display-print-category', nil, 'boolean') if displayPrintCategory then ret = ret .. makeCategoryLink(message('print-category')) end end return ret end ---------------------------------------------------------------------------- -- Tracking categories ---------------------------------------------------------------------------- function p.addTrackingCategories(env) --[[ -- Check if {{documentation}} is transcluded on a /doc or /testcases page. -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'display-strange-usage-category' --> true -- 'doc-subpage' --> 'doc' -- 'testcases-subpage' --> 'testcases' -- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage' -- -- /testcases pages in the module namespace are not categorised, as they may have -- {{documentation}} transcluded automatically. --]] local title = env.title local subjectSpace = env.subjectSpace if not title or not subjectSpace then return nil end local subpage = title.subpageText local ret = '' if message('display-strange-usage-category', nil, 'boolean') and ( subpage == message('doc-subpage') or subjectSpace ~= 828 and subpage == message('testcases-subpage') ) then ret = ret .. makeCategoryLink(message('strange-usage-category')) end return ret end return p d6028d23a1bb7cedd0ce7f776655dc03805e5059 テンプレート:Start date and age 10 71 154 2021-11-10T16:46:55Z ja>STS2657 0 [[特別:固定リンク/86305666]]版に引き続き、Lintエラー修正。一つ多い閉じspanタグの撤去。 wikitext text/x-wiki <includeonly><!-- IMPLEMENTATION OF DATE -->{{#if: {{{1|}}}<!-- -->|{{#if: {{{2|}}}<!-- -->|{{#if: {{{3|}}}<!-- -->|<span style="white-space:nowrap;">{{{1}}}年{{MONTHNAME|{{{2}}}}}{{#expr:{{{3}}}}}日</span><!-- -->|<span style="white-space:nowrap;">{{{1}}}年{{MONTHNAME|{{{2}}}}}</span><!-- -->}}<!-- -->|<span style="white-space:nowrap;">{{{1}}}年</span><!-- -->}}<!-- --><span class="noprint">{{#ifeq:{{yesno|{{{br|no}}}}}|yes|<br>|&#032;}}{{#ifeq:{{yesno|{{{paren|{{{p|yes}}}}}}}}|yes|(}}<!-- -->{{#if: {{{2|}}}<!-- -->|{{#if: {{{3|}}}<!-- -->|{{time ago|{{{1}}}-{{{2}}}-{{{3}}}}}<!-- -->|{{years or months ago|{{{1}}}|{{#time:n|1-{{{2}}}-1}}}}<!-- -->}}<!-- -->|{{#iferror:{{#expr:{{{1}}}}}<!-- -->|{{time ago|{{{1}}}}}<!-- -->|{{years or months ago|{{{1}}}}}<!-- -->}}<!-- -->}}<!-- -->{{#ifeq:{{yesno|{{{paren|{{{p|yes}}}}}}}}|yes|)}}</span><!-- -->|'''{{color|red|エラー: 第1パラメータの入力がありません。}}'''<!-- -->}}<!-- IMPLEMENTATION OF microformat date classes --><span style="display:none">&#160;(<span class="{{#ifeq:{{yesno|{{{end|no}}}}}|yes|dtend|bday dtstart published updated}}"><!-- -->{{#if: {{{1|}}}<!-- -->|{{{1}}}<!-- -->{{#if: {{{2|}}}<!-- -->| -{{#time:m|1-{{{2}}}-1}}<!-- -->{{#if: {{{3|}}}<!-- -->| -{{padleft:{{{3}}}|2|0}}<!-- -->}}<!-- -->}}<!-- -->}}<!-- --></span>)</span></includeonly><noinclude>{{Documentation}}</noinclude> 2319cef95fb9e114f0a232a9dbbd25211aef64d0 テンプレート:Time ago 10 72 156 2021-11-12T18:54:26Z ja>えのきだたもつ 0 「[[Template:Time ago]]」の保護設定を変更しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki {{#invoke:TimeAgo|main}}<noinclude> {{documentation}} <!-- Categories go in the /doc subpage and interwikis go in Wikidata. --> </noinclude> d2cffab74ae19a4214c4828401118edd5e86ed0e モジュール:TimeAgo 828 73 158 2021-11-12T18:54:26Z ja>えのきだたもつ 0 「[[モジュール:TimeAgo]]」の保護設定を変更しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) Scribunto text/plain -- Implement [[Template:Time ago]] local numberSpell, yesno -- lazy load function numberSpell(arg) numberSpell = require('Module:NumberSpell')._main return numberSpell(arg) end function yesno(arg) yesno = require('Module:Yesno') return yesno(arg) end local p = {} -- Table to convert entered text values to numeric values. local timeText = { ['seconds'] = 1, ['minutes'] = 60, ['hours'] = 3600, ['days'] = 86400, ['weeks'] = 604800, ['months'] = 2629800, -- 365.25 * 24 * 60 * 60 / 12 ['years'] = 31557600 } -- Table containing tables of possible units to use in output. local timeUnits = { [1] = { '秒', '秒', "秒", "秒" }, [60] = { '分', '分', "分", "分" }, [3600] = { '時間', '時間', "時間", "時間" }, [86400] = { '日', '日', "日", "日" }, [604800] = { '週間', '週間', "週間", "週間" }, [2629800] = { 'か月', 'か月', "か月", "か月" }, [31557600] = { '年', '年', "年", "年" } } function p._main( args ) -- Initialize variables local lang = mw.language.getContentLanguage() local auto_magnitude_num local min_magnitude_num local magnitude = args.magnitude local min_magnitude = args.min_magnitude local purge = args.purge -- Add a purge link if something (usually "yes") is entered into the purge parameter if purge then purge = ' <span class="plainlinks">([' .. mw.title.getCurrentTitle():fullUrl('action=purge') .. ' キャッシュを破棄])</span>' else purge = '' end -- Check that the entered timestamp is valid. If it isn't, then give an error message. local success, inputTime = pcall( lang.formatDate, lang, 'xnU', args[1] ) if not success then return '<strong class="error">エラー: 最初のパラメータを日付や時間として解析することができません。</strong>' end -- Store the difference between the current time and the inputted time, as well as its absolute value. local timeDiff = lang:formatDate( 'xnU' ) - inputTime local absTimeDiff = math.abs( timeDiff ) if magnitude then auto_magnitude_num = 0 min_magnitude_num = timeText[magnitude] else -- Calculate the appropriate unit of time if it was not specified as an argument. local autoMagnitudeData = { { factor = 2, amn = 31557600 }, { factor = 2, amn = 2629800 }, { factor = 2, amn = 86400 }, { factor = 2, amn = 3600 }, { factor = 2, amn = 60 } } for _, t in ipairs( autoMagnitudeData ) do if absTimeDiff / t.amn >= t.factor then auto_magnitude_num = t.amn break end end auto_magnitude_num = auto_magnitude_num or 1 if min_magnitude then min_magnitude_num = timeText[min_magnitude] else min_magnitude_num = -1 end end if not min_magnitude_num then -- Default to seconds if an invalid magnitude is entered. min_magnitude_num = 1 end local result_num local magnitude_num = math.max( min_magnitude_num, auto_magnitude_num ) local unit = timeUnits[magnitude_num].unit if unit and absTimeDiff >= 864000 then local Date = require('Module:Date2')._Date local input = lang:formatDate('Y-m-d H:i:s', args[1]) -- Date needs a clean date input = Date(input) if input then local id if input.hour == 0 and input.minute == 0 then id = 'currentdate' else id = 'currentdatetime' end result_num = (Date(id) - input):age(unit) end end result_num = result_num or math.floor ( absTimeDiff / magnitude_num ) local punctuation_key, suffix if timeDiff >= 0 then -- Past if result_num == 1 then punctuation_key = 1 else punctuation_key = 2 end if args.ago == '' then suffix = '' else suffix = '' .. (args.ago or '前') end else -- Future if args.ago == '' then suffix = '後' if result_num == 1 then punctuation_key = 1 else punctuation_key = 2 end else suffix = '後' if result_num == 1 then punctuation_key = 3 else punctuation_key = 4 end end end local result_unit = timeUnits[ magnitude_num ][ punctuation_key ] -- Convert numerals to words if appropriate. local spell_out = args.spellout local spell_out_max = tonumber(args.spelloutmax) local result_num_text if spell_out and ( ( spell_out == 'auto' and 1 <= result_num and result_num <= 9 and result_num <= ( spell_out_max or 9 ) ) or ( yesno( spell_out ) and 1 <= result_num and result_num <= 100 and result_num <= ( spell_out_max or 100 ) ) ) then result_num_text = numberSpell( result_num ) else result_num_text = tostring( result_num ) end local result = result_num_text .. '' .. result_unit .. suffix -- Spaces for suffix have been added in earlier. return result .. purge end function p.main( frame ) local args = require( 'Module:Arguments' ).getArgs( frame, { valueFunc = function( k, v ) if v then v = v:match( '^%s*(.-)%s*$' ) -- Trim whitespace. if k == 'ago' or v ~= '' then return v end end return nil end, wrappers = 'Template:Time ago' }) return p._main( args ) end return p 54f948e98c477249dd70530e79f29f38a8eddd79 テンプレート:Country flag alias World 10 68 148 2021-11-12T19:01:41Z ja>えのきだたもつ 0 「[[Template:Country flag alias World]]」の保護設定を変更しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki Perlshaper orthographic example1.svg<noinclude> [[Category:Country flag aliasテンプレート|world]] </noinclude> b2514f0210d302a65e57fd00f301969cbf840478 テンプレート:Country alias World 10 69 150 2021-11-12T19:01:42Z ja>えのきだたもつ 0 「[[Template:Country alias World]]」の保護設定を変更しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki 世界<noinclude> [[Category:Country aliasテンプレート|World]] </noinclude> c3b761cbad6b4bca611ed2786ead16fd9412a528 テンプレート:Color box 10 74 160 2021-11-12T19:02:22Z ja>えのきだたもつ 0 「[[Template:Color box]]」の保護設定を変更しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki <templatestyles src="Legend/styles.css" /><!-- --><span class="legend-color" style="<!-- -->{{#if:{{{1|}}}|{{greater color contrast ratio|{{{1}}}|black|white|css=y}}}}<!-- -->{{#if:{{{3|}}}|color:{{{3}}};}}<!-- -->{{#if:{{{border|}}}|border:1px solid {{{border}}};}}<!-- -->"><!-- -->{{#if:{{{2|}}}|&nbsp;{{{2}}}&nbsp;|&nbsp;}}</span><!-- --><noinclude>{{Documentation}}</noinclude> 10bc4f11ef1eb3da75caa24583999480efb28189 テンプレート:Para 10 37 86 2021-11-12T19:31:13Z ja>えのきだたもつ 0 「[[Template:Para]]」の保護設定を変更しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki <code class="nowrap" style="{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">&#124;{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}&#61;}}{{{2|}}}</code><noinclude> {{Documentation}}</noinclude> 34553ac52133be16b1e6cabcacbcc7a4b5eeeefc テンプレート:SUBJECTSPACE ja 10 46 104 2021-11-12T20:00:51Z ja>えのきだたもつ 0 「[[Template:SUBJECTSPACE ja]]」の保護設定を変更しました: 更新の必要性が低い重要ページ ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki <onlyinclude>{{#switch:{{SUBJECTSPACE}} | {{ns:0}} = | {{ns:2}} = 利用者 | {{ns:4}} = ウィキペディア | {{ns:6}} = ファイル | {{ns:8}} = メディアウィキ | {{ns:10}} = テンプレート | {{ns:12}} = ヘルプ | {{ns:14}} = カテゴリ | {{ns:100}} = ウィキポータル | {{ns:102}} = ウィキプロジェクト | {{ns:828}} = モジュール | #default = {{SUBJECTSPACE}} }}</onlyinclude> {{Documentation}} 2dc741185336763d6b6302f8f7aa52be74a9adf8 テンプレート:Multicol-end 10 40 92 2021-11-12T20:08:19Z ja>えのきだたもつ 0 「[[Template:Multicol-end]]」の保護設定を変更しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki <includeonly>&#32; |}</includeonly><noinclude> {{Documentation|Template:Multicol/doc}} </noinclude> 59156d19d925ddfd29a3c765b7e4704fe21d8b15 テンプレート:Multicol-break 10 39 90 2021-11-12T20:09:08Z ja>えのきだたもつ 0 「[[Template:Multicol-break]]」の保護設定を変更しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki <includeonly>&#32; | style="padding-right: {{{1|1.5em}}};"| </includeonly><noinclude> {{Documentation|Template:Multicol/doc}} [[Category:段組みテンプレート|Multicol-break]] </noinclude> b4fedad92a028aa95c4d4b9f4644c76b3c35a378 テンプレート:複雑なテンプレート 10 77 166 2021-11-12T20:09:19Z ja>えのきだたもつ 0 「[[Template:複雑なテンプレート]]」の保護設定を変更しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki {{ombox | type = style | image = [[File:Nuvola apps important yellow.svg|40x40px]] | text = このテンプレートの記述は複雑な構成となっています。編集後の結果が予想できないか、または変更にともなう影響を修正する用意ができていない場合は編集をお控えください。練習や実験は{{ #switch:{{NAMESPACE}} |モジュール=モジュール |#default=テンプレート }}の[[{{ #switch: {{SUBPAGENAME}} | doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}} | #default = {{SUBJECTPAGENAME}} }}/sandbox|サンドボックス・サブページ]]、[[{{ #switch: {{SUBPAGENAME}} | doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}} | #default = {{SUBJECTPAGENAME}} }}/testcases|テストケース・サブページ]]{{ #switch:{{NAMESPACE}} |モジュール= |#default=もしくはあなた自身の[[Wikipedia:利用者ページ|利用者スペース]]の[[特別:Mypage/sandbox|ページ]] }}でお願いします。}}<includeonly>{{ #switch: {{SUBPAGENAME}} | doc = | sandbox = | testcases = | {{ #switch: {{NAMESPACE}} | Template = [[Category:複雑なテンプレート{{#if: {{{1|}}} | {{!}}{{{1}}} }}]] }} }}</includeonly><noinclude> {{Documentation}} </noinclude> 61271f7c8b463f987d055974eef92031954f6ef0 テンプレート:Tag 10 51 114 2021-12-06T14:03:25Z ja>えのきだたもつ 0 「[[Template:Tag]]」の保護設定を変更しました: [[Wikipedia:影響が特に大きいテンプレート|影響が特に大きいテンプレート]] ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限)) wikitext text/x-wiki <code style="white-space:nowrap">{{#switch:{{{2|pair}}} |c|close = <!--nothing--> |s|single |o|open |p|pair = &lt;{{{1|tag}}}{{#if:{{{params|}}}|&#32;{{{params}}}}} }}{{#switch:{{{2|pair}}} |c|close = {{{content|}}} |s|single = &#32;&#47;&gt; |o|open = &gt;{{{content|}}} |p|pair = &gt;{{{content|...}}} }}{{#switch:{{{2|pair}}} |s|single |o|open = <!--nothing--> |c|close |p|pair = &lt;&#47;{{{1|tag}}}&gt; }}</code><noinclude> {{documentation}}</noinclude> 1aad85c935fe594a647382862e264899bf6d6bc4 テンプレート:Multicol 10 38 88 2022-01-07T22:35:17Z ja>JuthaDDA 0 脱字 wikitext text/x-wiki <includeonly>[[Category:段組みにテーブルを使用している記事]] {| class="{{{class|}}} multicol" role="presentation" style="padding: 0; border: 0; border-collapse: collapse; background-color: transparent; table-layout: fixed; width: {{{1|100%}}}" |- valign="top" | style="padding-right:{{{2|1.5em}}};" | </includeonly><noinclude> {{documentation}}</noinclude> b145a8f9425fb37716ad1988b5ea54c24441fb71 テンプレート:Cob 10 55 122 2022-04-10T02:00:41Z ja>ケンカッキー 0 Reverted 1 edit by [[Special:Contributions/2001:268:9093:B190:0:C:A6DE:5801|2001:268:9093:B190:0:C:A6DE:5801]] ([[User talk:2001:268:9093:B190:0:C:A6DE:5801|talk]]) (TwinkleGlobal) wikitext text/x-wiki #転送 [[Template:Collapse bottom]] de5ccb5b90ae27455ce8f18e40857ce90b299e2d テンプレート:Legend/styles.css 10 75 162 2022-04-21T09:23:04Z ja>Merliborn 0 text text/plain /* {{pp-template}} */ .legend { page-break-inside: avoid; break-inside: avoid-column; } .legend-color { display: inline-block; min-width: 1.5em; height: 1.5em; /* line-height: 1.5; */ margin: 1px 0; text-align: center; border: 1px solid black; background-color: transparent; color: black; } .legend-text {/*empty for now, but part of the design!*/} /* [[Category:テンプレートスタイル]] */ 5573ced404bda54aab5da4ded375d2d94bf19fa2 モジュール:Arguments/doc 828 56 124 2022-07-30T07:06:21Z ja>Kirche 0 wikitext text/x-wiki <includeonly>{{使用箇所の多いテンプレート|1,400,000以上}}{{pp-template}}</includeonly> <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | [[Category:Luaメタモジュール]] }}</includeonly> このモジュールは、{{Code|#invoke}} から渡された引数を処理できます。このモジュールは他のモジュールで使用するためのメタモジュールであり、{{Code|#invoke}} から直接呼び出すことはできません。 次のような機能があります。 * 引数のトリミングと空引数の削除。 * 引数を現在のフレームと親フレームの両方から同時に渡すことができます(後述)。 * 引数を、別のLuaモジュールまたはデバッグコンソールから直接渡すことができます。 * 多くの機能はカスタマイズ性を備えます == 基本 == モジュールをロードする必要があります。モジュールには <code>getArgs</code> という名前の関数が1つ含まれています。 <syntaxhighlight lang="lua"> local getArgs = require('Module:Arguments').getArgs </syntaxhighlight> メイン関数内でgetArgsを使用する最も基本的なシナリオです。変数 <code>args</code> は、{{Code|#invoke}} からの引数を含むテーブル型です。 <syntaxhighlight lang="lua"> local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) -- Main module code goes here. end return p </syntaxhighlight> === Recommended practice === However, the recommended practice is to use a function just for processing arguments from #invoke. This means that if someone calls your module from another Lua module you don't have to have a frame object available, which improves performance. <syntaxhighlight lang="lua"> local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) return p._main(args) end function p._main(args) -- Main module code goes here. end return p </syntaxhighlight> The way this is called from a template is <code><nowiki>{{#invoke:Example|main}}</nowiki></code> (optionally with some parameters like <code><nowiki>{{#invoke:Example|main|arg1=value1|arg2=value2}}</nowiki></code>), and the way this is called from a module is <syntaxhighlight lang=lua inline>require('Module:Example')._main({arg1 = 'value1', arg2 = value2, 'spaced arg3' = 'value3'})</syntaxhighlight>. What this second one does is construct a table with the arguments in it, then gives that table to the p._main(args) function, which uses it natively. === Multiple functions === If you want multiple functions to use the arguments, and you also want them to be accessible from #invoke, you can use a wrapper function. <syntaxhighlight lang="lua"> local getArgs = require('Module:Arguments').getArgs local p = {} local function makeInvokeFunc(funcName) return function (frame) local args = getArgs(frame) return p[funcName](args) end end p.func1 = makeInvokeFunc('_func1') function p._func1(args) -- Code for the first function goes here. end p.func2 = makeInvokeFunc('_func2') function p._func2(args) -- Code for the second function goes here. end return p </syntaxhighlight> === Options === The following options are available. They are explained in the sections below. <syntaxhighlight lang="lua"> local args = getArgs(frame, { trim = false, removeBlanks = false, valueFunc = function (key, value) -- Code for processing one argument end, frameOnly = true, parentOnly = true, parentFirst = true, wrappers = { 'Template:A wrapper template', 'Template:Another wrapper template' }, readOnly = true, noOverwrite = true }) </syntaxhighlight> === Trimming and removing blanks === Blank arguments often trip up coders new to converting MediaWiki templates to Lua. In template syntax, blank strings and strings consisting only of whitespace are considered false. However, in Lua, blank strings and strings consisting of whitespace are considered true. This means that if you don't pay attention to such arguments when you write your Lua modules, you might treat something as true that should actually be treated as false. To avoid this, by default this module removes all blank arguments. Similarly, whitespace can cause problems when dealing with positional arguments. Although whitespace is trimmed for named arguments coming from #invoke, it is preserved for positional arguments. Most of the time this additional whitespace is not desired, so this module trims it off by default. However, sometimes you want to use blank arguments as input, and sometimes you want to keep additional whitespace. This can be necessary to convert some templates exactly as they were written. If you want to do this, you can set the <code>trim</code> and <code>removeBlanks</code> arguments to <code>false</code>. <syntaxhighlight lang="lua"> local args = getArgs(frame, { trim = false, removeBlanks = false }) </syntaxhighlight> === Custom formatting of arguments === Sometimes you want to remove some blank arguments but not others, or perhaps you might want to put all of the positional arguments in lower case. To do things like this you can use the <code>valueFunc</code> option. The input to this option must be a function that takes two parameters, <code>key</code> and <code>value</code>, and returns a single value. This value is what you will get when you access the field <code>key</code> in the <code>args</code> table. Example 1: this function preserves whitespace for the first positional argument, but trims all other arguments and removes all other blank arguments. <syntaxhighlight lang="lua"> local args = getArgs(frame, { valueFunc = function (key, value) if key == 1 then return value elseif value then value = mw.text.trim(value) if value ~= '' then return value end end return nil end }) </syntaxhighlight> Example 2: this function removes blank arguments and converts all arguments to lower case, but doesn't trim whitespace from positional parameters. <syntaxhighlight lang="lua"> local args = getArgs(frame, { valueFunc = function (key, value) if not value then return nil end value = mw.ustring.lower(value) if mw.ustring.find(value, '%S') then return value end return nil end }) </syntaxhighlight> Note: the above functions will fail if passed input that is not of type <code>string</code> or <code>nil</code>. This might be the case if you use the <code>getArgs</code> function in the main function of your module, and that function is called by another Lua module. In this case, you will need to check the type of your input. This is not a problem if you are using a function specially for arguments from #invoke (i.e. you have <code>p.main</code> and <code>p._main</code> functions, or something similar). {{cot|Examples 1 and 2 with type checking}} Example 1: <syntaxhighlight lang="lua"> local args = getArgs(frame, { valueFunc = function (key, value) if key == 1 then return value elseif type(value) == 'string' then value = mw.text.trim(value) if value ~= '' then return value else return nil end else return value end end }) </syntaxhighlight> Example 2: <syntaxhighlight lang="lua"> local args = getArgs(frame, { valueFunc = function (key, value) if type(value) == 'string' then value = mw.ustring.lower(value) if mw.ustring.find(value, '%S') then return value else return nil end else return value end end }) </syntaxhighlight> {{cob}} Also, please note that the <code>valueFunc</code> function is called more or less every time an argument is requested from the <code>args</code> table, so if you care about performance you should make sure you aren't doing anything inefficient with your code. === Frames and parent frames === Arguments in the <code>args</code> table can be passed from the current frame or from its parent frame at the same time. To understand what this means, it is easiest to give an example. Let's say that we have a module called <code>Module:ExampleArgs</code>. This module prints the first two positional arguments that it is passed. {{cot|Module:ExampleArgs code}} <syntaxhighlight lang="lua"> local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) return p._main(args) end function p._main(args) local first = args[1] or '' local second = args[2] or '' return first .. ' ' .. second end return p </syntaxhighlight> {{cob}} <code>Module:ExampleArgs</code> is then called by <code>Template:ExampleArgs</code>, which contains the code <code><nowiki>{{#invoke:ExampleArgs|main|firstInvokeArg}}</nowiki></code>. This produces the result "firstInvokeArg". Now if we were to call <code>Template:ExampleArgs</code>, the following would happen: {| class="wikitable" style="width: 50em; max-width: 100%;" |- ! style="width: 60%;" | Code ! style="width: 40%;" | Result |- | <code><nowiki>{{ExampleArgs}}</nowiki></code> | firstInvokeArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg}}</nowiki></code> | firstInvokeArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg|secondTemplateArg}}</nowiki></code> | firstInvokeArg secondTemplateArg |} There are three options you can set to change this behaviour: <code>frameOnly</code>, <code>parentOnly</code> and <code>parentFirst</code>. If you set <code>frameOnly</code> then only arguments passed from the current frame will be accepted; if you set <code>parentOnly</code> then only arguments passed from the parent frame will be accepted; and if you set <code>parentFirst</code> then arguments will be passed from both the current and parent frames, but the parent frame will have priority over the current frame. Here are the results in terms of <code>Template:ExampleArgs</code>: ; frameOnly {| class="wikitable" style="width: 50em; max-width: 100%;" |- ! style="width: 60%;" | Code ! style="width: 40%;" | Result |- | <code><nowiki>{{ExampleArgs}}</nowiki></code> | firstInvokeArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg}}</nowiki></code> | firstInvokeArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg|secondTemplateArg}}</nowiki></code> | firstInvokeArg |} ; parentOnly {| class="wikitable" style="width: 50em; max-width: 100%;" |- ! style="width: 60%;" | Code ! style="width: 40%;" | Result |- | <code><nowiki>{{ExampleArgs}}</nowiki></code> | |- | <code><nowiki>{{ExampleArgs|firstTemplateArg}}</nowiki></code> | firstTemplateArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg|secondTemplateArg}}</nowiki></code> | firstTemplateArg secondTemplateArg |} ; parentFirst {| class="wikitable" style="width: 50em; max-width: 100%;" |- ! style="width: 60%;" | Code ! style="width: 40%;" | Result |- | <code><nowiki>{{ExampleArgs}}</nowiki></code> | firstInvokeArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg}}</nowiki></code> | firstTemplateArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg|secondTemplateArg}}</nowiki></code> | firstTemplateArg secondTemplateArg |} Notes: # If you set both the <code>frameOnly</code> and <code>parentOnly</code> options, the module won't fetch any arguments at all from #invoke. This is probably not what you want. # In some situations a parent frame may not be available, e.g. if getArgs is passed the parent frame rather than the current frame. In this case, only the frame arguments will be used (unless parentOnly is set, in which case no arguments will be used) and the <code>parentFirst</code> and <code>frameOnly</code> options will have no effect. === Wrappers === The ''wrappers'' option is used to specify a limited number of templates as ''wrapper templates'', that is, templates whose only purpose is to call a module. If the module detects that it is being called from a wrapper template, it will only check for arguments in the parent frame; otherwise it will only check for arguments in the frame passed to getArgs. This allows modules to be called by either #invoke or through a wrapper template without the loss of performance associated with having to check both the frame and the parent frame for each argument lookup. For example, the only content of [[Template:Side box]] (excluding content in {{tag|noinclude}} tags) is <code><nowiki>{{#invoke:Side box|main}}</nowiki></code>. There is no point in checking the arguments passed directly to the #invoke statement for this template, as no arguments will ever be specified there. We can avoid checking arguments passed to #invoke by using the ''parentOnly'' option, but if we do this then #invoke will not work from other pages either. If this were the case, the {{para|text|Some text}} in the code <code><nowiki>{{#invoke:Side box|main|text=Some text}}</nowiki></code> would be ignored completely, no matter what page it was used from. By using the <code>wrappers</code> option to specify 'Template:Side box' as a wrapper, we can make <code><nowiki>{{#invoke:Side box|main|text=Some text}}</nowiki></code> work from most pages, while still not requiring that the module check for arguments on the [[Template:Side box]] page itself. Wrappers can be specified either as a string, or as an array of strings. <syntaxhighlight lang="lua"> local args = getArgs(frame, { wrappers = 'Template:Wrapper template' }) </syntaxhighlight> <syntaxhighlight lang="lua"> local args = getArgs(frame, { wrappers = { 'Template:Wrapper 1', 'Template:Wrapper 2', -- Any number of wrapper templates can be added here. } }) </syntaxhighlight> Notes: # The module will automatically detect if it is being called from a wrapper template's /sandbox subpage, so there is no need to specify sandbox pages explicitly. # The ''wrappers'' option effectively changes the default of the ''frameOnly'' and ''parentOnly'' options. If, for example, ''parentOnly'' were explicitly set to 0 with ''wrappers'' set, calls via wrapper templates would result in both frame and parent arguments being loaded, though calls not via wrapper templates would result in only frame arguments being loaded. # If the ''wrappers'' option is set and no parent frame is available, the module will always get the arguments from the frame passed to <code>getArgs</code>. === Writing to the args table === Sometimes it can be useful to write new values to the args table. This is possible with the default settings of this module. (However, bear in mind that it is usually better coding style to create a new table with your new values and copy arguments from the args table as needed.) <syntaxhighlight lang="lua"> args.foo = 'some value' </syntaxhighlight> It is possible to alter this behaviour with the <code>readOnly</code> and <code>noOverwrite</code> options. If <code>readOnly</code> is set then it is not possible to write any values to the args table at all. If <code>noOverwrite</code> is set, then it is possible to add new values to the table, but it is not possible to add a value if it would overwrite any arguments that are passed from #invoke. === Ref tags === This module uses [[mw:Extension:Scribunto/Lua reference manual#Metatables|metatables]] to fetch arguments from #invoke. This allows access to both the frame arguments and the parent frame arguments without using the <code>pairs()</code> function. This can help if your module might be passed {{tag|ref}} tags as input. As soon as {{tag|ref}} tags are accessed from Lua, they are processed by the MediaWiki software and the reference will appear in the reference list at the bottom of the article. If your module proceeds to omit the reference tag from the output, you will end up with a phantom reference – a reference that appears in the reference list but without any number linking to it. This has been a problem with modules that use <code>pairs()</code> to detect whether to use the arguments from the frame or the parent frame, as those modules automatically process every available argument. This module solves this problem by allowing access to both frame and parent frame arguments, while still only fetching those arguments when it is necessary. The problem will still occur if you use <code>pairs(args)</code> elsewhere in your module, however. === Known limitations === The use of metatables also has its downsides. Most of the normal Lua table tools won't work properly on the args table, including the <code>#</code> operator, the <code>next()</code> function, and the functions in the table library. If using these is important for your module, you should use your own argument processing function instead of this module. d28a0a456f641c9a0ea9e0665371cd69596395ae テンプレート:Collapse bottom 10 53 118 2022-08-26T11:46:21Z ja>Kohaku2005 0 閉じdivタグを追加。Lintエラー防止のため、コードをincludeonly化。 wikitext text/x-wiki <includeonly>|}</div></includeonly><noinclude> [[Category:折りたたみ表示テンプレート|{{PAGENAME}}]] </noinclude> 4b2c2058be204c83d011bb731bd7bd1ddc21de50 テンプレート:World 10 78 168 2022-09-05T23:19:18Z 2001:268:C0A4:3C59:700D:C562:267F:3876 0 [[Special:Contributions/2001:268:9434:9CBB:8171:33E4:5645:9757|2001:268:9434:9CBB:8171:33E4:5645:9757]] ([[User talk:2001:268:9434:9CBB:8171:33E4:5645:9757|会話]]) による ID:87144373 の版を[[H:RV|取り消し]] wikitext text/x-wiki {{Flagicon|World}} [[世界]]<noinclude> [[Category:各国の国旗と国名テンプレート|World]] </noinclude> 2e8f6333d4065c7730bc80cfef0584f85da6051a テンプレート:Infobox 鉄道路線 10 12 36 2022-12-20T11:14:21Z ja>Antilovsky 0 wikitext text/x-wiki {{Infobox |name = Infobox 鉄道路線 |bodyclass = |bodystyle = width:300px; |abovestyle = {{#if:{{{路線色|}}}|border-top: 4px solid {{{路線色}}}; border-bottom: 4px solid {{#if:{{{路線色2|}}}|{{{路線色2}}}|{{{路線色}}}}};}} |above = {{{路線名|{{PAGENAME}}}}} |subheader = {{#invoke:InfoboxImage|InfoboxImage|image={{{ロゴ|}}}|size={{{ロゴサイズ|90px}}}|sizedefault=90px|alt=シンボルマーク}} |image = {{#invoke:InfoboxImage|InfoboxImage|image={{{画像|}}}|size={{{画像サイズ|300px}}}|sizedefault=300px|alt={{{画像説明|}}}}} |caption = {{{画像説明<includeonly>|</includeonly>}}} |headerstyle= background: #efefef; |header1 = 基本情報 |label2 = 通称 |data2 = {{{通称<includeonly>|</includeonly>}}} |label3 = 現況 |data3 = {{{現況<includeonly>|</includeonly>}}} |label4 = 国 |data4 = {{{国<includeonly>|</includeonly>}}} |label5 = 所在地 |data5 = {{{所在地<includeonly>|</includeonly>}}} |label7 = 種類 |data7 = {{{種類<includeonly>|</includeonly>}}} |label8 = 路線網 |data8 = {{{路線網<includeonly>|</includeonly>}}} |label9 = 区間 |data9 = {{{区間<includeonly>|</includeonly>}}} |label10 = 起点 |data10 = {{{起点<includeonly>|</includeonly>}}} |label11 = 終点 |data11 = {{{終点<includeonly>|</includeonly>}}} |label12 = 駅数 |data12 = {{{駅数<includeonly>|</includeonly>}}} |label13 = 停留場数 |data13 = {{{停留場数<includeonly>|</includeonly>}}} |label14 = 停留所数 |data14 = {{{停留所数<includeonly>|</includeonly>}}} |label15 = 経由路線 |data15 = {{{経由路線<includeonly>|</includeonly>{{{構成路線|}}}}}} |label16 = 輸送実績 |data16 = {{{輸送実績<includeonly>|</includeonly>}}} |label17 = 1日利用者数 |data17 = {{{1日利用者数<includeonly>|</includeonly>}}} |label18 = [[電報略号 (鉄道)|電報略号]] |data18 = {{{電報略号<includeonly>|</includeonly>}}} |label19 = 路線記号 |data19 = {{{路線記号<includeonly>|</includeonly>}}} |label20 = 路線番号 |data20 = {{{路線番号<includeonly>|</includeonly>}}} |label21 = [[日本の鉄道ラインカラー一覧|路線色]] |data21 = {{{路線色3<includeonly>|</includeonly>}}} |header30 = <!--運営--> |label31 = 開業 |data31 = {{{開業<includeonly>|</includeonly>}}} |label32 = {{{項目1|}}} |data32 = {{{日付1|}}} |label33 = {{{項目2|}}} |data33 = {{{日付2|}}} |label34 = {{{項目3|}}} |data34 = {{{日付3|}}} |label35 = 最終延伸 |data35 = {{{最終延伸<includeonly>|</includeonly>}}} |label36 = 全通 |data36 = {{{全通<includeonly>|</includeonly>}}} |label37 = 休止 |data37 = {{{休止<includeonly>|</includeonly>}}} |label38 = 廃止 |data38 = {{{廃止<includeonly>|</includeonly>}}} |label39 = 再開 |data39 = {{{再開<includeonly>|</includeonly>}}} |label40 = 所有者 |data40 = {{{所有者<includeonly>|</includeonly>}}} |label41 = 運営者 |data41 = {{{運営者<includeonly>|</includeonly>{{{運行者|}}}}}} |label42 = 路線構造 |data42 = {{{路線構造<includeonly>|</includeonly>}}} |label43 = [[運転指令所]] |data43 = {{{運転指令所<includeonly>|</includeonly>}}} |label44 = [[車両基地]] |data44 = {{{車両基地<includeonly>|</includeonly>}}} |label45 = 使用車両 |data45 = {{{使用車両<includeonly>|</includeonly>}}} |header50 = 路線諸元 |label51 = 路線距離 |data51 = {{{路線距離<includeonly>|</includeonly>{{{総延長|}}}}}} |label53 = [[営業キロ]] |data53 = {{{営業キロ<includeonly>|</includeonly>}}} |label54 = [[軌間]] |data54 = {{{軌間<includeonly>|</includeonly>}}} |label57 = 線路数 |data57 = {{{線路数<includeonly>|</includeonly>}}} |label58 = [[複線|複線区間]] |data58 = {{{複線区間|}}} |label59 = 電化区間 |data59 = {{{電化区間|}}} |label60 = [[鉄道の電化|電化方式]] |data60 = {{{電化方式<includeonly>|</includeonly>}}} |label61 = [[車両限界]] |data61 = {{{車両限界<includeonly>|</includeonly>}}} |label62 = [[線形 (路線)#勾配|最大勾配]] |data62 = {{{最大勾配<includeonly>|</includeonly>}}} |label63 = [[線形 (路線)#平面線形|最小曲線半径]] |data63 = {{{最小曲線半径<includeonly>|</includeonly>}}} |label64 = 高低差 |data64 = {{{高低差<includeonly>|</includeonly>}}} |label65 = [[閉塞 (鉄道)|閉塞方式]] |data65 = {{{閉塞方式<includeonly>|</includeonly>}}} |label66 = [[自動列車保安装置|保安装置]] |data66 = {{{保安装置<includeonly>|</includeonly>}}} |label67 = [[ラック式鉄道|ラック方式]] |data67 = {{{ラック方式<includeonly>|</includeonly>}}} |label68 = [[鉄道の最高速度|最高速度]] |data68 = {{{最高速度<includeonly>|</includeonly>}}} |label69 = 駅間平均長 |data69 = {{{駅間平均長<includeonly>|</includeonly>}}} |label70 = {{{諸元備考<includeonly>|</includeonly>}}} |data70 = {{{諸元備考内容<includeonly>|</includeonly>}}} |belowstyle = vertical-align: middle; padding:0px; |below = {{#if:{{{路線図<includeonly>|</includeonly>}}}| <table style="width:100%; margin:0; border:none;" class="mw-collapsible {{#switch:{{{路線図表示|}}}|0 |no |#default = no |1 |yes |collapsed = mw-collapsed autocollapse }}"> <tr style="background-color: #efefef"><th>{{#if:{{{路線図名|}}}|{{{路線図名}}}|路線図}}</th></tr> <tr><td style="text-align:center"> {{#invoke:InfoboxImage|InfoboxImage|image={{{路線図<noinclude>|File:Placeholder.svg</noinclude>}}}|size=|sizedefault=300px}}</td></tr> </table>}} }}<noinclude>{{Documentation}}</noinclude> 3186fa29d3e1322d9e31d22493072ed545f8ea8e テンプレート:Infobox 鉄道路線/doc 10 79 170 2022-12-20T11:19:21Z ja>Antilovsky 0 /* 引数解説・機能比較 */ wikitext text/x-wiki <noinclude>{{Documentation subpage}}</noinclude>{{Sandbox other||{{使用箇所の多いテンプレート|1,900以上}}{{複雑なテンプレート}}}} [[鉄道路線]]の情報を表示する基礎情報テンプレートです。英語版から翻案された[[Template:Infobox rail line]]とは異なり、引数の日本語化や日本語版での需要に合わせ項目を調整しています。 == 使い方 == {{See also|[[#使用例]]}} 項目は全て省略可能。不明な情報は空白のままで構いません。基本項目の雛形をベースに必要に応じて全項目の中から選び出すことで、未入力項目による記事の容量増加を最小限に抑えられます。 *全引数一覧 <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名 = |路線色 = #000000 |路線色2 = #000000 |ロゴ = <!-- ロゴ.svg --> |ロゴサイズ = <!--px--> |画像 = <!-- 画像.jpg --> |画像サイズ = <!--px--> |画像説明 = |通称 = |現況 = |国 = |所在地 = |種類 = |路線網 = |区間 = |起点 = [[駅]] |終点 = [[駅]] |駅数 = 駅 |停留場数 = 停留場 |停留所数 = 停留所 |経由路線 = |輸送実績 = |1日利用者数 = |電報略号 = |路線記号 = |路線番号 = |路線色3 = |開業 = |項目1 = |日付1 = |項目2 = |日付2 = |項目3 = |日付3 = |最終延伸 = |全通 = |休止 = |廃止 = |再開 = |所有者 = |運営者 = |運転指令所 = |車両基地 = |使用車両 = |路線構造 = |路線距離 = km |営業キロ = km |軌間 = mm |線路数 = |複線区間 = |電化区間 = |電化方式 = |車両限界 = |最大勾配 = ‰ |最小曲線半径 = m |高低差 = m |閉塞方式 = |保安装置 = |ラック方式 = |最高速度 = km/h |駅間平均長 = |諸元備考 = |諸元備考内容 = |路線図 = |路線図名 = |路線図表示 = <!--collapsed--> }} </pre> == 引数解説・機能比較 == このテンプレートで表示可能な機能、および[[Template:Infobox rail line]]との機能比較は以下の通りです。テンプレートの移行や各言語版間の翻訳時に参考にしてください。 {| class="wikitable" style="font-size:90%" |- !colspan="2" |引数<!--順序はInfobox 鉄道路線準拠--> !colspan="2" |ラベル名 !rowspan="2" |Infobox 鉄道路線における定義<br />(Infobox 鉄道路線にない引数はInfobox rail lineの定義) |- !style="white-space:nowrap"|[[Template:Infobox rail line|rail line]] !style="white-space:nowrap"|[[Template:Infobox 鉄道路線|鉄道路線]] !style="white-space:nowrap"|rail line !style="white-space:nowrap"|鉄道路線 |- | <code>box_width</code> || {{n/a}} || || {{n/a}} || Infoboxの幅を指定(Infobox 鉄道路線では300pxで固定)。 |- |- | <code>name</code> || <code>路線名</code> || || || 路線名。デフォルト設定は記事名。 |- | <code>color</code> || <code>路線色</code> || || || 路線の色を指定。[[ウェブカラー#16進トリプレット表記|6桁]]で色を表す場合は頭の "#" '''付き'''で入力。 |- | <code>color2</code> || <code>路線色2</code> || || || 第二の色を指定(Infobox 鉄道路線では指定しなくても上下のラインカラーの帯が揃う)。 |- | <code>logo</code><br /><code>logo2</code> || <code>ロゴ</code> || || || ロゴを路線名の下に配置('''1つのみ'''表示可能)。冒頭の「ファイル:」は省略。 |- | <code>logo_width</code><br /><code>logo_width2</code> || <code>ロゴサイズ</code> || || || ロゴの横幅を指定。デフォルト設定は'''90px'''。 |- | <code>logo_alt</code><br /><code>logo_alt2</code> || {{n/a}} || || {{n/a}} || ロゴマークの代替テキスト(Infobox 鉄道路線では「シンボルマーク」で固定)。 |- | <code>image</code> || <code>画像</code> || || || 画像のファイル名を入力。冒頭の「ファイル:」は省略。 |- | <code>image_width</code> || <code>画像サイズ</code> || || || 画像の横幅を指定。デフォルト設定は'''300px'''。 |- | <code>image_alt</code> || {{n/a}} || || {{n/a}} || 画像の代替テキスト(Infobox 鉄道路線では「画像説明」と同じ内容が表示される)。 |- | <code>caption</code> || <code>画像説明</code> || || || 画像の説明。 |- ! colspan="5" | 概要・運営 / 基本情報 |- | <code>other_name</code> || <code>通称</code> || 通称 || 通称 || 路線の通称。 |- | <code>native_name</code> || {{n/a}} || 現地表記 || {{n/a}} || 路線の現地語表記(海外の鉄道など)。 |- | <code>native_name_lang</code> || {{n/a}} || || {{n/a}} || 現地語の種類。[[ISO 639-2コード一覧|ISO 639-2コード]]に準じる。言語を複数表記する場合は {{tl|lang}} を使う。 |- | <code>status</code> || <code>現況</code> || 現況 || 現況 || 路線の現況(計画中、工事中、廃止、未成など。現役路線では使用しない)。 |- | {{n/a}} || <code>国</code> || {{n/a}} || 国 || 路線が所在する国や地域。[[Wikipedia:Template国名3レターコード]]利用を想定。 |- | <code>locale</code> || <code>所在地</code> || 所在地 || 所在地 || 路線が通る地域名・自治体名(路線規模によって適宜簡潔にまとめる)。<br/>都道府県旗や地方旗の画像は挿入しない(詳しくは[[プロジェクト:鉄道#アイコン画像によるマークアップ]]を参照。「routes」「owner」「operator」の記述も、このガイドラインによるものです)。 |- | <code>coordinates</code> || {{n/a}} || 座標 || {{n/a}} || 路線の緯度と経度。{{Tl|Coord}}を使用。 |- | <code>type</code> || <code>種類</code> || 種別 || 種類 || 鉄道の類型([[高速鉄道]]、[[路面電車]]、[[モノレール]]など) |- | <code>system</code> || <code>路線網</code> || 系統 || 路線網 || 路線が属する路線網や系統、システム名。 |- | {{n/a}} || <code>区間</code> || {{n/a}} || 区間 || |- | <code>start</code> || <code>起点</code> || rowspan="2" style="vertical-align:top" | 起終点 || 起点 || 路線の起点駅や地域名。 |- | <code>end</code> || <code>終点</code> || 終点 || 路線の終点駅や地域名。 |- | <code>stations</code> || <code>駅数</code> || 駅数 || 駅数 || 駅の数(特記なければは起終点駅を含む)。 |- | {{n/a}} || <code>停留場数</code> || {{n/a}} || 停留場数 || 停留場の数(同上)。 |- | {{n/a}} || <code>停留所数</code> || {{n/a}} || 停留所数 || 停留所の数(同上)。 |- | <code>continuesfrom</code><br /><code>continuesas</code><br /><code>connectinglines</code><br /> || {{n/a}} || 接続路線 || {{n/a}} || 当該路線に接続する路線。 |- | <code>routes</code> || <code>経由路線</code><br /><code>構成路線</code> || 路線 || 経由路線 || 経由する線籍上の路線名称を記入([[運転系統]]向け)。<br/>路線シンボルマーク等の画像は挿入しない。 |- | <code>ridership2</code> || <code>輸送実績</code> || 乗客数 || 輸送実績 || 年単位等の輸送実績が公表されている場合に記入。 |- | <code>ridership</code> || <code>1日利用者数</code> || 1日の乗客数 || 1日利用者数 || 1日利用者数が公表されている場合に記入。 |- | {{n/a}} || <code>電報略号</code> || {{n/a}} || 電報略号 || 路線の[[電報略号 (鉄道)|電報略号]]。 |- | <code>trainnumber</code> || {{n/a}} || 列車番号 || {{n/a}} || チケットや時刻表に記入される列車番号。 |- | <code>linenumber</code> || <code>路線記号</code> || 路線記号 || 路線記号 || 路線記号。 |- | <code>routenumber</code> || <code>路線番号</code> || ルート番号 || 路線番号 || 路線番号(Infobox rail lineでは「路線諸元」に位置する)。 |- | <code>mapcolour</code><br /><code>mapcolor</code> || <code>路線色3</code> || 路線カラー || 路線色 || 路線色を冒頭の帯とは別に記載する場合に記入。 |- | <code>mapcolourlink</code><br /><code>mapcolorlink</code> || {{n/a}} || || {{n/a}} || 路線色のリンク先がある場合に記入。 |- | <code>website</code> || {{draw|提案中}} || ウェブサイト || {{draw|ウェブサイト}} || 路線の外部リンク(公式サイト等)を表示。 |- | <code>open</code> || <code>開業</code> || 開業 || 開業 || 路線が最初に開業した年月日。 |- | <code>event1</code><br /><code>event2</code><br /><code>event3</code><br /> || <code>日付1</code><br /><code>日付2</code><br /><code>日付3</code> ||<code>event1label</code><br /><code>event2label</code><br /><code>event3label</code> || <code>項目1</code><br /><code>項目2</code><br /><code>項目3</code> || 路線の延長、短縮、移管などの変遷日を任意のラベル名で記載。<br />"<code>項目1=</code>"のラベル名に対応した日付を"<code>日付1=</code>"に記入。3つまで設定可能。 |- | <code>lastextension</code> || <code>最終延伸</code> || 最終延伸 || 最終延伸 || 計画、工事路線が現段階で延伸した期日。 |- | {{draw|提案中}} || <code>全通</code> || {{draw|全通}} || 全通 || 予定された全区間が開業した期日。 |- | {{n/a}} || <code>休止</code> || {{n/a}} || 休止 || 路線が休止した年月日。 |- | <code>close</code> || <code>廃止</code> || 廃止 || 廃止 || 路線が廃止された年月日。 |- | <code>reopen</code> || <code>再開</code> || 再開 || 再開 || 休廃止後に再び開業した年月日。 |- | <code>owner</code> || <code>所有者</code> || 所有者 || 所有者 || 運営者と異なる所有者が存在する場合に記入(第一種、第三種鉄道事業に相当)。<br/>企業ロゴ等の画像は挿入しない。 |- | <code>operator</code> || <code>運営者</code><br /><code>運行者</code> || 運営者 || 運営者 || 路線を運営している事業者を記入(第一種、第二種鉄道事業に相当)。<br/>企業ロゴ等の画像は挿入しない。 |- | <code>conductionsystem</code> || {{n/a}} || 運行方法 || {{n/a}} || 路線の運行方法。 |- | <code>character</code> || <code>路線構造</code> || 路線構造 || 路線構造 || 路線の構造(高架など)。都市鉄道向け。 |- | {{n/a}} || <code>運転指令所</code> || {{n/a}} || 運転指令所 || 路線の運転指令所。 |- | <code>depot</code> || <code>車両基地</code> || 車両基地 || 車両基地 || 路線の車両基地や車庫。 |- | <code>stock</code> || <code>使用車両</code> || 使用車両 || 使用車両 || 路線で使われている車両(種類が多岐にわたる場合は使用しない)。 |- ! colspan="5" |路線諸元 |- | <code>linelength</code><br /><code>linelength_footnotes</code> || <code>路線距離</code><br /><code>総延長</code> || rowspan="3" | 路線総延長 || rowspan="3" | 路線距離 || 路線の総延長。キロメートル ([[キロメートル|km]]) で記載(要記号)。 |- | <code>linelength_km</code> || {{n/a}} || キロメートル→[[マイル]]自動変換機能。記号なしでキロメートル入力。 |- | <code>linelength_mi</code> || {{n/a}} || マイル→キロメートル自動変換機能。記号なしでマイル入力。 |- | <code>tracklength</code><br /><code>tracklength_footnotes</code> || {{n/a}} || rowspan="3" | 線路総延長 || {{n/a}} || 線路の総延長(例えば複線ならそれぞれの単線の長さを合算)。キロメートル (km) で記載(要記号)。 |- | <code>tracklength_km</code> || {{n/a}} || {{n/a}} || キロメートル→マイル自動変換機能。記号なしでキロメートル入力。 |- | <code>tracklength_mi</code> || {{n/a}} || {{n/a}} || マイル→キロメートル自動変換機能。記号なしでマイル入力。 |- | {{n/a}} || <code>営業キロ</code> || {{n/a}} || 営業キロ || [[営業キロ]]。 |- | <code>gauge</code> || <code>軌間</code> || 軌間 || 軌間 || 路線の[[軌間]]を記入。ミリメートル ([[ミリメートル|mm]]) で記載(要記号)。[[狭軌]]、[[標準軌]]、[[広軌]]といった補記は適宜手動入力。 |- | <code>ogauge</code> || {{n/a}} || 過去の軌間 || {{n/a}} || [[改軌]]前の軌間を記入。 |- | <code>notrack</code> || <code>線路数</code> || 路線数 || 線路数 || 単線、複線など路線上の線路数を記入。 |- | {{n/a}} || <code>複線区間</code> || {{n/a}} || 複線区間 || 複線区間。 |- | {{n/a}} || <code>電化区間</code> || {{n/a}} || 電化区間 || [[鉄道の電化|電化]]区間。 |- | <code>el</code> || <code>電化方式</code> || 電化 || 電化方式 || 路線の電圧や電化形式([[第三軌条方式]]、[[架空電車線方式]]等)。 |- | <code>lgauge</code> || <code>車両限界</code> || 車両限界 || 車両限界 || 路線の[[車両限界]]。 |- | <code>maxincline</code> || <code>最大勾配</code> || 最急勾配 || 最大勾配 || 路線の最急勾配。パーミル ([[パーミル|‰]]) で記載(要記号)。 |- | <code>minradius</code> || style="white-space:nowrap"| <code>最小曲線半径</code> || rowspan="3" | 最小曲線半径 || rowspan="3" style="white-space:nowrap"| 最小曲線半径 || 路線の最小曲線半径。メートル ([[メートル|m]]) で記載(要記号)。 |- | <code>minradius_m</code> || {{n/a}} || メートル→[[フィート]]自動変換機能。記号なしでメートル入力。 |- | <code>minradius_ft</code> || {{n/a}} || フィート→メートル自動変換機能。記号なしでフィート入力。 |- | <code>elevation</code> || {{n/a}} || rowspan="3" | 最高地点 || {{n/a}} || 路線の最標高地点。メートル (m) で記載(要記号)。 |- | <code>elevation_m</code> || {{n/a}} || {{n/a}} || メートル→フィート自動変換機能。記号なしでメートル入力。 |- | <code>elevation_ft</code> || {{n/a}} || {{n/a}} || フィート→メートル自動変換機能。記号なしでフィート入力。 |- | {{n/a}} || <code>高低差</code> || {{n/a}} || 高低差 || 路線の標高差([[登山鉄道]]等で使用)。メートル (m) で記載(要記号)。 |- | {{n/a}} || <code>閉塞方式</code> || {{n/a}} || 閉塞方式 || 路線の[[閉塞 (鉄道)|閉塞方式]]。 |- | {{n/a}} || <code>保安装置</code> || {{n/a}} || 保安装置 || 路線の[[自動列車保安装置|保安装置]]。 |- | <code>racksystem</code> || <code>ラック方式</code> || ラック方式 || ラック方式 || [[ラック式鉄道]]の方式を記入(例:[[アプト式]])。 |- | <code>ra</code> || {{n/a}} || RA || {{n/a}} || [[:en:Route availability]]。イギリスの線路規格。 |- | <code>speed</code> || <code>最高速度</code> || rowspan="3" | 運行速度 || rowspan="3" | 最高速度 || 路線の速度(最高速度)。キロメートル毎時 ([[キロメートル毎時|km/h]]) で記載(要記号)。 |- | <code>speed_km/h</code> || {{n/a}} || キロメートル毎時→[[マイル毎時]]自動変換機能。記号なしでキロメートル毎時入力。 |- | <code>speed_mph</code> || {{n/a}} || マイル毎時→キロメートル自動変換機能。記号なしでマイル毎時入力。 |- | <code>aveinterstation</code> || <code>駅間平均長</code> || 駅間平均長 || 駅間平均長 || 駅間平均距離。キロメートル (km) で記載(要記号)。 |- | {{n/a}} || <code>諸元備考内容</code> || {{n/a}} || <code>諸元備考</code> || 諸元に関する上記項目にない要素を盛り込む際に使用。<br />"<code>諸元備考=</code>"のラベル名(追加要素)に対応した内容を"<code>諸元備考内容=</code>"に記入。 |- ! colspan="5" |路線図 |- | <code>map</code> || <code>路線図</code> || || || 路線図を表示。 |- | <code>map_name</code> || <code>路線図名</code> || || || 図の上部にある「路線図」の名称を変更可能。 |- | <code>map_state</code> || <code>路線図表示</code> || || || <code>collapsed</code>と入力することでデフォルトで図を折り畳む。 |- |} == 例 == {{Infobox 鉄道路線 |路線名=A線 |路線色=#FF0000<!--赤--> |路線色2=#0000FF<!--青--> |ロゴ= |ロゴサイズ=50px<!--デフォルトサイズ--> |画像=Information example page2 300px.jpg |画像サイズ=250px<!--デフォルトサイズ--> |画像説明=表示例 |通称=エー線 |現況=休止 |国={{World}} |所在地=世界 |種類=[[高速鉄道]] |路線網=地球路線網 |起点=A駅 |終点=z停留所 |駅数=26駅 |停留場数=26停留場 |停留所数=26停留所 |経由路線=A本線、B支線、C連絡線 |輸送実績=3,650,000 (1950年) |1日利用者数=10,000 (1950年) |電報略号=エエ |路線記号=A |路線番号=1 |路線色3={{Color box|#008000}}<!--緑--> |開業=1910年1月1日 |項目1=国有化 |日付1=1920年2月2日 |項目2=民営化 |日付2=1930年3月3日 |項目3=区間縮小 |日付3=1940年4月4日 |最終延伸=1950年5月5日 |全通= |休止=1960年6月6日 |廃止= |再開= |所有者=地球 |運営者=人類 |車両基地=南極 |使用車両=[[#車両|車両]]を参照 |路線構造=高架 |路線距離=2,000km |営業キロ=1,500km |軌間=1,435 mm ([[標準軌]]) |線路数=[[単線]] |複線区間=A駅 - a停留場間 |電化区間=z停留場 - z停留所間 |電化方式=[[架空電車線方式]] |最大勾配=50‰ |最小曲線半径=500m |高低差=1,000m |閉塞方式=スタフ閉塞式 |保安装置=[[自動列車制御装置|ATC]] |ラック方式=マーシュ式 |最高速度=100km/h |路線図=Example.svg |路線図名=A線路線図 |路線図表示=collapsed }} <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名=A線 |路線色=#FF0000<!--赤--> |路線色2=#0000FF<!--青--> |ロゴ= |ロゴサイズ=50px<!--デフォルトサイズ--> |画像=Information example page2 300px.jpg |画像サイズ=250px<!--デフォルトサイズ--> |画像説明=表示例 |通称=エー線 |現況=休止 |国={{World}} |所在地=世界 |種類=[[高速鉄道]] |路線網=地球路線網 |起点=A駅 |終点=z停留所 |駅数=26駅 |停留場数=26停留場 |停留所数=26停留所 |経由路線=A本線、B支線、C連絡線 |輸送実績=3,650,000 (1950年) |1日利用者数=10,000 (1950年) |電報略号=エエ |路線記号=A |路線番号=1 |路線色3={{Color box|#008000}}<!--緑--> |開業=1910年1月1日 |項目1=国有化 |日付1=1920年2月2日 |項目2=民営化 |日付2=1930年3月3日 |項目3=区間縮小 |日付3=1940年4月4日 |最終延伸=1950年5月5日 |全通= |休止=1960年6月6日 |廃止= |再開= |所有者=地球 |運営者=人類 |車両基地=南極 |使用車両=[[#車両|車両]]を参照 |路線構造=高架 |路線距離=2,000km |営業キロ=1,500km |軌間=1,435 mm ([[標準軌]]) |線路数=[[単線]] |複線区間=A駅 - a停留場間 |電化区間=z停留場 - z停留所間 |電化方式=[[架空電車線方式]] |最大勾配=50‰ |最小曲線半径=500m |高低差=1,000m |閉塞方式=スタフ閉塞式 |保安装置=[[自動列車制御装置|ATC]] |ラック方式=マーシュ式 |最高速度=100km/h |路線図=Example.svg |路線図名=A線路線図 |路線図表示=collapsed }} </pre> == 使用例 == === 例1 === * [[山陽新幹線]] {{Infobox 鉄道路線 |路線名=[[File:JR logo (west).svg|35px|link=西日本旅客鉄道]] 山陽新幹線 |画像=JRW N700-7000series S1.jpg |画像サイズ=300px |画像説明=主に「さくら」で運転されているN700系7000番台 |国={{JPN}} |所在地=[[大阪府]]、[[兵庫県]]、[[岡山県]]、[[広島県]]、[[山口県]]、[[福岡県]] |種類=[[高速鉄道]]([[新幹線]]) |起点=[[新大阪駅]] |終点=[[博多駅]] |駅数=19駅 |開業=[[1972年]][[3月15日]] (新大阪駅-[[岡山駅]])<br />[[1975年]][[3月10日]] (岡山駅-博多駅) |所有者=[[西日本旅客鉄道]](JR西日本) |運営者=西日本旅客鉄道(JR西日本) |車両基地=[[博多総合車両所]] |路線距離=557.3 [[キロメートル|km]] |営業キロ=644.0 km |線路数=[[複線]] |軌間=1,435 [[ミリメートル|mm]] ([[標準軌]]) |電化方式=交流25,000[[ボルト (単位)|V]]・60[[ヘルツ|Hz]] [[架空電車線方式]] |最大勾配=15 [[パーミル|‰]] |最小曲線半径=4,000 [[メートル|m]] |閉塞方式=車内信号式 |保安装置=[[自動列車制御装置#ATC-1型(東海道・山陽型)|ATC-1W]]および[[自動列車制御装置#ATC-NS|ATC-NS]]([[新幹線700系電車|700系]]7000番台以外の車両における新大阪駅構内のみ) |最高速度=300 [[キロメートル毎時|km/h]] }} <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名=[[File:JR logo (west).svg|35px|link=西日本旅客鉄道]] 山陽新幹線 |画像=JRW N700-7000series S1.jpg |画像サイズ=300px |画像説明=主に「さくら」で運転されているN700系7000番台 |国={{JPN}} |所在地=[[大阪府]]、[[兵庫県]]、[[岡山県]]、[[広島県]]、[[山口県]]、[[福岡県]] |種類=[[高速鉄道]]([[新幹線]]) |起点=[[新大阪駅]] |終点=[[博多駅]] |駅数=19駅 |開業=[[1972年]][[3月15日]] (新大阪駅-[[岡山駅]])<br />[[1975年]][[3月10日]] (岡山駅-博多駅) |所有者=[[西日本旅客鉄道]](JR西日本) |運営者=西日本旅客鉄道(JR西日本) |車両基地=[[博多総合車両所]] |路線距離=557.3 [[キロメートル|km]] |営業キロ=644.0 km |線路数=[[複線]] |軌間=1,435 [[ミリメートル|mm]] ([[標準軌]]) |電化方式=交流25,000[[ボルト (単位)|V]]・60[[ヘルツ|Hz]] [[架空電車線方式]] |最大勾配=15 [[パーミル|‰]] |最小曲線半径=4,000 [[メートル|m]] |閉塞方式=車内信号式 |保安装置=[[自動列車制御装置#ATC-1型(東海道・山陽型)|ATC-1W]]および[[自動列車制御装置#ATC-NS|ATC-NS]]([[新幹線700系電車|700系]]7000番台以外の車両における新大阪駅構内のみ) |最高速度=300 [[キロメートル毎時|km/h]] }} </pre> === 例2 === * [[京浜東北線]] {{Infobox 鉄道路線 |路線名=[[File:JR logo (east).svg|35px|link=東日本旅客鉃道]] 京浜東北線 |路線色=#00b2e5 |ロゴ=JR JK line symbol.svg |ロゴサイズ=40px |画像=Series-E233-1000-113.jpg |画像サイズ=300px |画像説明=主力車両の[[JR東日本E233系電車|E233系1000番台]]<br>(2021年3月 さいたま新都心駅) |国={{JPN}} |所在地=[[埼玉県]]、[[東京都]]、[[神奈川県]] |種類=[[日本の鉄道|普通鉄道]]([[在来線]]・[[幹線]]) |区間=[[大宮駅 (埼玉県)|大宮駅]] - [[横浜駅]]間 |駅数=36駅 |電報略号=トホホセ(大宮 - 東京間)<br>トカホセ(東京 - 横浜間) |路線記号=JK |経由路線=[[東北本線]]、[[東海道本線]] |開業={{Start date and age|1914|12|20}} |廃止= |所有者=[[東日本旅客鉄道]](JR東日本) |運営者=東日本旅客鉄道(JR東日本) |車両基地=[[さいたま車両センター]] |使用車両=[[JR東日本E233系電車|E233系1000番台]] 10両 |路線距離=59.1 km |軌間=1,067 [[ミリメートル|mm]] |線路数=[[複線]] |電化方式=[[直流電化|直流]]1,500 [[ボルト (単位)|V]] [[架空電車線方式]] |最高速度=90 [[キロメートル毎時|km/h]] }} <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名=[[File:JR logo (east).svg|35px|link=東日本旅客鉃道]] 京浜東北線 |路線色=#00b2e5 |ロゴ=JR JK line symbol.svg |ロゴサイズ=40px |画像=Series-E233-1000-113.jpg |画像サイズ=300px |画像説明=主力車両の[[JR東日本E233系電車|E233系1000番台]]<br>(2021年3月 さいたま新都心駅) |国={{JPN}} |所在地=[[埼玉県]]、[[東京都]]、[[神奈川県]] |種類=[[日本の鉄道|普通鉄道]]([[在来線]]・[[幹線]]) |区間=[[大宮駅 (埼玉県)|大宮駅]] - [[横浜駅]]間 |駅数=36駅 |電報略号=トホホセ(大宮 - 東京間)<br>トカホセ(東京 - 横浜間) |路線記号=JK |経由路線=[[東北本線]]、[[東海道本線]] |開業={{Start date and age|1914|12|20}} |廃止= |所有者=[[東日本旅客鉄道]](JR東日本) |運営者=東日本旅客鉄道(JR東日本) |車両基地=[[さいたま車両センター]] |使用車両=[[JR東日本E233系電車|E233系1000番台]] 10両 |路線距離=59.1 km |軌間=1,067 [[ミリメートル|mm]] |線路数=[[複線]] |電化方式=[[直流電化|直流]]1,500 [[ボルト (単位)|V]] [[架空電車線方式]] |最高速度=90 [[キロメートル毎時|km/h]] }} </pre> === 例3 === * [[中央線快速]] {{Infobox 鉄道路線 |路線名=[[File:JR logo (east).svg|35px|東日本旅客鉄道|link=東日本旅客鉄道]] 中央線快速 |路線色=#f15a22 |ロゴ=JR JC line symbol.svg |ロゴサイズ=40px |画像=Series209-1000 E233-130th.jpg |画像サイズ=300px |画像説明=中央線快速の車両[[JR東日本209系電車|209系]](左)と[[JR東日本E233系電車|E233系]](右)<br />(2019年6月29日 [[西国分寺駅]]) |国={{JPN}} |所在地=[[東京都]] |種類=[[通勤列車]] |起点=[[東京駅]] |終点=[[高尾駅 (東京都)|高尾駅]] |駅数=24駅 |電報略号=チウホセ |路線記号=JC |経由路線=[[東北本線]](東京 - 神田間)<br>[[中央本線]](神田 - 代々木間、新宿 - 高尾間)<br>[[山手線]](代々木 - 新宿間) |開業={{Start date and age|1889|4|11}} |廃止= |所有者=[[東日本旅客鉄道]](JR東日本) |運営者=東日本旅客鉄道(JR東日本) |車両基地=[[豊田車両センター]] |使用車両=[[JR東日本E233系電車#0番台|E233系0番台]]<br>[[JR東日本209系電車#1000番台|209系1000番台]] |路線距離=53.1 [[キロメートル|km]] |軌間=1,067 [[ミリメートル|mm]] |線路数=[[複線]] |電化方式=[[直流電化|直流]]1,500 [[ボルト (単位)|V]] [[架空電車線方式]] |閉塞方式=自動閉塞式 |保安装置=[[自動列車停止装置#ATS-P形(デジタル伝送パターン形)|ATS-P]] |最高速度=100 [[キロメートル毎時|km/h]]<br>130 km/h(八王子 - 高尾間の特急列車) }} <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名=[[File:JR logo (east).svg|35px|東日本旅客鉄道|link=東日本旅客鉄道]] 中央線快速 |路線色=#f15a22 |ロゴ=JR JC line symbol.svg |ロゴサイズ=40px |画像=Series209-1000 E233-130th.jpg |画像サイズ=300px |画像説明=中央線快速の車両[[JR東日本209系電車|209系]](左)と[[JR東日本E233系電車|E233系]](右)<br />(2019年6月29日 [[西国分寺駅]]) |国={{JPN}} |所在地=[[東京都]] |種類=[[通勤列車]] |起点=[[東京駅]] |終点=[[高尾駅 (東京都)|高尾駅]] |駅数=24駅 |電報略号=チウホセ |路線記号=JC |経由路線=[[東北本線]](東京 - 神田間)<br>[[中央本線]](神田 - 代々木間、新宿 - 高尾間)<br>[[山手線]](代々木 - 新宿間) |開業={{Start date and age|1889|4|11}} |廃止= |所有者=[[東日本旅客鉄道]](JR東日本) |運営者=東日本旅客鉄道(JR東日本) |車両基地=[[豊田車両センター]] |使用車両=[[JR東日本E233系電車#0番台|E233系0番台]]<br>[[JR東日本209系電車#1000番台|209系1000番台]] |路線距離=53.1 [[キロメートル|km]] |軌間=1,067 [[ミリメートル|mm]] |線路数=[[複線]] |電化方式=[[直流電化|直流]]1,500 [[ボルト (単位)|V]] [[架空電車線方式]] |閉塞方式=自動閉塞式 |保安装置=[[自動列車停止装置#ATS-P形(デジタル伝送パターン形)|ATS-P]] |最高速度=100 [[キロメートル毎時|km/h]]<br>130 km/h(八王子 - 高尾間の特急列車) }} </pre> == 関連テンプレート == * {{tl|Infobox 公共交通機関}} - 複数路線で構成されるネットワーク・システムの情報を集約する場合に用いるテンプレート。 * {{tl|BS-map}} - [[Wikipedia:経路図テンプレート|経路図]]を入力するテンプレート。 <includeonly> {{DEFAULTSORT:Infobox てつとうろせん}} [[Category:鉄道の基礎情報テンプレート|ろせん]] </includeonly> 982825136037a2f57e0b5573c99a2eb6fbade1ab モジュール:Protection banner 828 23 58 2023-02-12T06:32:26Z ja>ネイ 0 strict Scribunto text/plain -- This module implements {{pp-meta}} and its daughter templates such as -- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}. -- Initialise necessary modules. require('strict') local makeFileLink = require('Module:File link')._main local effectiveProtectionLevel = require('Module:Effective protection level')._main local effectiveProtectionExpiry = require('Module:Effective protection expiry')._main local yesno = require('Module:Yesno') -- Lazily initialise modules and objects we don't always need. local getArgs, makeMessageBox, lang -- Set constants. local CONFIG_MODULE = 'モジュール:Protection banner/config' -------------------------------------------------------------------------------- -- Helper functions -------------------------------------------------------------------------------- local function makeCategoryLink(cat, sort) if cat then return string.format( '[[%s:%s|%s]]', mw.site.namespaces[14].name, cat, sort ) end end -- Validation function for the expiry and the protection date local function validateDate(dateString, dateType) if not lang then lang = mw.language.getContentLanguage() end local success, result = pcall(lang.formatDate, lang, 'U', dateString) if success then result = tonumber(result) if result then return result end end error(string.format( 'invalid %s: %s', dateType, tostring(dateString) ), 4) end local function makeFullUrl(page, query, display) return string.format( '[%s %s]', tostring(mw.uri.fullUrl(page, query)), display ) end -- Given a directed graph formatted as node -> table of direct successors, -- get a table of all nodes reachable from a given node (though always -- including the given node). local function getReachableNodes(graph, start) local toWalk, retval = {[start] = true}, {} while true do -- Can't use pairs() since we're adding and removing things as we're iterating local k = next(toWalk) -- This always gets the "first" key if k == nil then return retval end toWalk[k] = nil retval[k] = true for _,v in ipairs(graph[k]) do if not retval[v] then toWalk[v] = true end end end end -------------------------------------------------------------------------------- -- Protection class -------------------------------------------------------------------------------- local Protection = {} Protection.__index = Protection Protection.supportedActions = { edit = true, move = true, autoreview = true, upload = true } Protection.bannerConfigFields = { 'text', 'explanation', 'tooltip', 'alt', 'link', 'image' } function Protection.new(args, cfg, title) local obj = {} obj._cfg = cfg obj.title = title or mw.title.getCurrentTitle() -- Set action if not args.action then obj.action = 'edit' elseif Protection.supportedActions[args.action] then obj.action = args.action else error(string.format( 'invalid action: %s', tostring(args.action) ), 3) end -- Set level obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title) if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then -- Users need to be autoconfirmed to move pages anyway, so treat -- semi-move-protected pages as unprotected. obj.level = '*' end -- Set expiry local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title) if effectiveExpiry == 'infinity' then obj.expiry = 'indef' elseif effectiveExpiry ~= 'unknown' then obj.expiry = validateDate(effectiveExpiry, 'expiry date') end -- Set reason if args[1] then obj.reason = mw.ustring.lower(args[1]) if obj.reason:find('|') then error('reasons cannot contain the pipe character ("|")', 3) end end -- Set protection date if args.date then obj.protectionDate = validateDate(args.date, 'protection date') end -- Set banner config do obj.bannerConfig = {} local configTables = {} if cfg.banners[obj.action] then configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason] end if cfg.defaultBanners[obj.action] then configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level] configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default end configTables[#configTables + 1] = cfg.masterBanner for i, field in ipairs(Protection.bannerConfigFields) do for j, t in ipairs(configTables) do if t[field] then obj.bannerConfig[field] = t[field] break end end end end return setmetatable(obj, Protection) end function Protection:isProtected() return self.level ~= '*' end function Protection:isTemporary() return type(self.expiry) == 'number' end function Protection:makeProtectionCategory() local cfg = self._cfg local title = self.title -- Exit if the page is not protected. if not self:isProtected() then return '' end -- Get the expiry key fragment. local expiryFragment if self.expiry == 'indef' then expiryFragment = self.expiry elseif type(self.expiry) == 'number' then expiryFragment = 'temp' end -- Get the namespace key fragment. local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace] if not namespaceFragment and title.namespace % 2 == 1 then namespaceFragment = 'talk' end -- Define the order that key fragments are tested in. This is done with an -- array of tables containing the value to be tested, along with its -- position in the cfg.protectionCategories table. local order = { {val = expiryFragment, keypos = 1}, {val = namespaceFragment, keypos = 2}, {val = self.reason, keypos = 3}, {val = self.level, keypos = 4}, {val = self.action, keypos = 5} } --[[ -- The old protection templates used an ad-hoc protection category system, -- with some templates prioritising namespaces in their categories, and -- others prioritising the protection reason. To emulate this in this module -- we use the config table cfg.reasonsWithNamespacePriority to set the -- reasons for which namespaces have priority over protection reason. -- If we are dealing with one of those reasons, move the namespace table to -- the end of the order table, i.e. give it highest priority. If not, the -- reason should have highest priority, so move that to the end of the table -- instead. --]] table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3)) --[[ -- Define the attempt order. Inactive subtables (subtables with nil "value" -- fields) are moved to the end, where they will later be given the key -- "all". This is to cut down on the number of table lookups in -- cfg.protectionCategories, which grows exponentially with the number of -- non-nil keys. We keep track of the number of active subtables with the -- noActive parameter. --]] local noActive, attemptOrder do local active, inactive = {}, {} for i, t in ipairs(order) do if t.val then active[#active + 1] = t else inactive[#inactive + 1] = t end end noActive = #active attemptOrder = active for i, t in ipairs(inactive) do attemptOrder[#attemptOrder + 1] = t end end --[[ -- Check increasingly generic key combinations until we find a match. If a -- specific category exists for the combination of key fragments we are -- given, that match will be found first. If not, we keep trying different -- key fragment combinations until we match using the key -- "all-all-all-all-all". -- -- To generate the keys, we index the key subtables using a binary matrix -- with indexes i and j. j is only calculated up to the number of active -- subtables. For example, if there were three active subtables, the matrix -- would look like this, with 0 corresponding to the key fragment "all", and -- 1 corresponding to other key fragments. -- -- j 1 2 3 -- i -- 1 1 1 1 -- 2 0 1 1 -- 3 1 0 1 -- 4 0 0 1 -- 5 1 1 0 -- 6 0 1 0 -- 7 1 0 0 -- 8 0 0 0 -- -- Values of j higher than the number of active subtables are set -- to the string "all". -- -- A key for cfg.protectionCategories is constructed for each value of i. -- The position of the value in the key is determined by the keypos field in -- each subtable. --]] local cats = cfg.protectionCategories for i = 1, 2^noActive do local key = {} for j, t in ipairs(attemptOrder) do if j > noActive then key[t.keypos] = 'all' else local quotient = i / 2 ^ (j - 1) quotient = math.ceil(quotient) if quotient % 2 == 1 then key[t.keypos] = t.val else key[t.keypos] = 'all' end end end key = table.concat(key, '|') local attempt = cats[key] if attempt then return makeCategoryLink(attempt, title.text) end end return '' end function Protection:isIncorrect() local expiry = self.expiry return not self:isProtected() or type(expiry) == 'number' and expiry < os.time() end -- 日本語版独自 function Protection:isMismatched() return self.reason == 'dispute' and self.level ~= 'sysop' end function Protection:isTemplateProtectedNonTemplate() local action, namespace = self.action, self.title.namespace return self.level == 'templateeditor' and ( (action ~= 'edit' and action ~= 'move') or (namespace ~= 10 and namespace ~= 828) ) end function Protection:makeCategoryLinks() local msg = self._cfg.msg local ret = { self:makeProtectionCategory() } if self:isIncorrect() then ret[#ret + 1] = makeCategoryLink( msg['tracking-category-incorrect'], self.title.text ) elseif self:isMismatched() then ret[#ret + 1] = makeCategoryLink( msg['tracking-category-mismatch'], self.title.text ) end if self:isTemplateProtectedNonTemplate() then ret[#ret + 1] = makeCategoryLink( msg['tracking-category-template'], self.title.text ) end return table.concat(ret) end -------------------------------------------------------------------------------- -- Blurb class -------------------------------------------------------------------------------- local Blurb = {} Blurb.__index = Blurb Blurb.bannerTextFields = { text = true, explanation = true, tooltip = true, alt = true, link = true } function Blurb.new(protectionObj, args, cfg) return setmetatable({ _cfg = cfg, _protectionObj = protectionObj, _args = args }, Blurb) end -- Private methods -- function Blurb:_formatDate(num) -- Formats a Unix timestamp into dd Month, YYYY format. lang = lang or mw.language.getContentLanguage() local success, date = pcall( lang.formatDate, lang, self._cfg.msg['expiry-date-format'] or 'j F Y', '@' .. tostring(num) ) if success then return date end end function Blurb:_getExpandedMessage(msgKey) return self:_substituteParameters(self._cfg.msg[msgKey]) end function Blurb:_substituteParameters(msg) if not self._params then local parameterFuncs = {} parameterFuncs.CURRENTVERSION = self._makeCurrentVersionParameter parameterFuncs.EDITREQUEST = self._makeEditRequestParameter parameterFuncs.EXPIRY = self._makeExpiryParameter parameterFuncs.EXPLANATIONBLURB = self._makeExplanationBlurbParameter parameterFuncs.IMAGELINK = self._makeImageLinkParameter parameterFuncs.INTROBLURB = self._makeIntroBlurbParameter parameterFuncs.INTROFRAGMENT = self._makeIntroFragmentParameter parameterFuncs.PAGETYPE = self._makePagetypeParameter parameterFuncs.PROTECTIONBLURB = self._makeProtectionBlurbParameter parameterFuncs.PROTECTIONDATE = self._makeProtectionDateParameter parameterFuncs.PROTECTIONLEVEL = self._makeProtectionLevelParameter parameterFuncs.PROTECTIONLOG = self._makeProtectionLogParameter parameterFuncs.TALKPAGE = self._makeTalkPageParameter parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter parameterFuncs.VANDAL = self._makeVandalTemplateParameter self._params = setmetatable({}, { __index = function (t, k) local param if parameterFuncs[k] then param = parameterFuncs[k](self) end param = param or '' t[k] = param return param end }) end msg = msg:gsub('${(%u+)}', self._params) return msg end function Blurb:_makeCurrentVersionParameter() -- A link to the page history or the move log, depending on the kind of -- protection. local pagename = self._protectionObj.title.prefixedText if self._protectionObj.action == 'move' then -- We need the move log link. return makeFullUrl( 'Special:Log', {type = 'move', page = pagename}, self:_getExpandedMessage('current-version-move-display') ) else -- We need the history link. return makeFullUrl( pagename, {action = 'history'}, self:_getExpandedMessage('current-version-edit-display') ) end end function Blurb:_makeEditRequestParameter() local mEditRequest = require('Module:Submit an edit request') local action = self._protectionObj.action local level = self._protectionObj.level -- Get the edit request type. local requestType if action == 'edit' then if level == 'autoconfirmed' then requestType = 'semi' elseif level == 'extendedconfirmed' then requestType = 'extended' elseif level == 'templateeditor' then requestType = 'template' end end requestType = requestType or 'full' -- Get the display value. local display = self:_getExpandedMessage('edit-request-display') return mEditRequest._link{type = requestType, display = display} end function Blurb:_makeExpiryParameter() local expiry = self._protectionObj.expiry if type(expiry) == 'number' then return self:_formatDate(expiry) else return expiry end end function Blurb:_makeExplanationBlurbParameter() -- Cover special cases first. if self._protectionObj.title.namespace == 8 then -- MediaWiki namespace return self:_getExpandedMessage('explanation-blurb-nounprotect') end -- Get explanation blurb table keys local action = self._protectionObj.action local level = self._protectionObj.level local talkKey = self._protectionObj.title.isTalkPage and 'talk' or 'subject' -- Find the message in the explanation blurb table and substitute any -- parameters. local explanations = self._cfg.explanationBlurbs local msg if explanations[action][level] and explanations[action][level][talkKey] then msg = explanations[action][level][talkKey] elseif explanations[action][level] and explanations[action][level].default then msg = explanations[action][level].default elseif explanations[action].default and explanations[action].default[talkKey] then msg = explanations[action].default[talkKey] elseif explanations[action].default and explanations[action].default.default then msg = explanations[action].default.default else error(string.format( 'could not find explanation blurb for action "%s", level "%s" and talk key "%s"', action, level, talkKey ), 8) end return self:_substituteParameters(msg) end function Blurb:_makeImageLinkParameter() local imageLinks = self._cfg.imageLinks local action = self._protectionObj.action local level = self._protectionObj.level local msg if imageLinks[action][level] then msg = imageLinks[action][level] elseif imageLinks[action].default then msg = imageLinks[action].default else msg = imageLinks.edit.default end return self:_substituteParameters(msg) end function Blurb:_makeIntroBlurbParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('intro-blurb-expiry') else return self:_getExpandedMessage('intro-blurb-noexpiry') end end function Blurb:_makeIntroFragmentParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('intro-fragment-expiry') else return self:_getExpandedMessage('intro-fragment-noexpiry') end end function Blurb:_makePagetypeParameter() local pagetypes = self._cfg.pagetypes return pagetypes[self._protectionObj.title.namespace] or pagetypes.default or error('no default pagetype defined', 8) end function Blurb:_makeProtectionBlurbParameter() local protectionBlurbs = self._cfg.protectionBlurbs local action = self._protectionObj.action local level = self._protectionObj.level local msg if protectionBlurbs[action][level] then msg = protectionBlurbs[action][level] elseif protectionBlurbs[action].default then msg = protectionBlurbs[action].default elseif protectionBlurbs.edit.default then msg = protectionBlurbs.edit.default else error('no protection blurb defined for protectionBlurbs.edit.default', 8) end return self:_substituteParameters(msg) end function Blurb:_makeProtectionDateParameter() local protectionDate = self._protectionObj.protectionDate if type(protectionDate) == 'number' then return self:_formatDate(protectionDate) else return protectionDate end end function Blurb:_makeProtectionLevelParameter() local protectionLevels = self._cfg.protectionLevels local action = self._protectionObj.action local level = self._protectionObj.level local msg if protectionLevels[action][level] then msg = protectionLevels[action][level] elseif protectionLevels[action].default then msg = protectionLevels[action].default elseif protectionLevels.edit.default then msg = protectionLevels.edit.default else error('no protection level defined for protectionLevels.edit.default', 8) end return self:_substituteParameters(msg) end function Blurb:_makeProtectionLogParameter() local pagename = self._protectionObj.title.prefixedText if self._protectionObj.action == 'autoreview' then -- We need the pending changes log. return makeFullUrl( 'Special:Log', {type = 'stable', page = pagename}, self:_getExpandedMessage('pc-log-display') ) else -- We need the protection log. return makeFullUrl( 'Special:Log', {type = 'protect', page = pagename}, self:_getExpandedMessage('protection-log-display') ) end end function Blurb:_makeTalkPageParameter() return string.format( '[[%s:%s#%s|%s]]', mw.site.namespaces[self._protectionObj.title.namespace].talk.name, self._protectionObj.title.text, self._args.section or 'top', self:_getExpandedMessage('talk-page-link-display') ) end function Blurb:_makeTooltipBlurbParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('tooltip-blurb-expiry') else return self:_getExpandedMessage('tooltip-blurb-noexpiry') end end function Blurb:_makeTooltipFragmentParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('tooltip-fragment-expiry') else return self:_getExpandedMessage('tooltip-fragment-noexpiry') end end function Blurb:_makeVandalTemplateParameter() return require('Module:Vandal-m')._main{ self._args.user or self._protectionObj.title.baseText } end -- Public methods -- function Blurb:makeBannerText(key) -- Validate input. if not key or not Blurb.bannerTextFields[key] then error(string.format( '"%s" is not a valid banner config field', tostring(key) ), 2) end -- Generate the text. local msg = self._protectionObj.bannerConfig[key] if type(msg) == 'string' then return self:_substituteParameters(msg) elseif type(msg) == 'function' then msg = msg(self._protectionObj, self._args) if type(msg) ~= 'string' then error(string.format( 'bad output from banner config function with key "%s"' .. ' (expected string, got %s)', tostring(key), type(msg) ), 4) end return self:_substituteParameters(msg) end end -------------------------------------------------------------------------------- -- BannerTemplate class -------------------------------------------------------------------------------- local BannerTemplate = {} BannerTemplate.__index = BannerTemplate function BannerTemplate.new(protectionObj, cfg) local obj = {} obj._cfg = cfg -- Set the image filename. local imageFilename = protectionObj.bannerConfig.image if imageFilename then -- 日本語版独自の条件分岐 if type(imageFilename) == 'string' then obj._imageFilename = imageFilename elseif type(imageFilename) == 'function' then obj._imageFilename = imageFilename(protectionObj) end else -- If an image filename isn't specified explicitly in the banner config, -- generate it from the protection status and the namespace. local action = protectionObj.action local level = protectionObj.level local namespace = protectionObj.title.namespace local reason = protectionObj.reason -- Deal with special cases first. if ( namespace == 10 or namespace == 828 or reason and obj._cfg.indefImageReasons[reason] ) and action == 'edit' and level == 'sysop' and not protectionObj:isTemporary() then -- Fully protected modules and templates get the special red "indef" -- padlock. obj._imageFilename = obj._cfg.msg['image-filename-indef'] else -- Deal with regular protection types. local images = obj._cfg.images if images[action] then if images[action][level] then obj._imageFilename = images[action][level] elseif images[action].default then obj._imageFilename = images[action].default end end end end return setmetatable(obj, BannerTemplate) end function BannerTemplate:renderImage() local filename = self._imageFilename or self._cfg.msg['image-filename-default'] or 'Transparent.gif' return makeFileLink{ file = filename, size = (self.imageSize or 'x20') .. 'px', -- 日本語版独自の変更 alt = self._imageAlt, link = self._imageLink, caption = self.imageCaption } end -------------------------------------------------------------------------------- -- Banner class -------------------------------------------------------------------------------- local Banner = setmetatable({}, BannerTemplate) Banner.__index = Banner function Banner.new(protectionObj, blurbObj, cfg) local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb. obj.imageSize = 40 -- 日本語版独自の変更: フィールド名 obj.imageCaption = blurbObj:makeBannerText('alt') -- Large banners use the alt text for the tooltip. obj._reasonText = blurbObj:makeBannerText('text') obj._explanationText = blurbObj:makeBannerText('explanation') obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing. return setmetatable(obj, Banner) end function Banner:__tostring() -- Renders the banner. makeMessageBox = makeMessageBox or require('Module:Message box').main local reasonText = self._reasonText or error('no reason text set', 2) local explanationText = self._explanationText local mbargs = { page = self._page, type = 'protection', image = self:renderImage(), text = string.format( "'''%s'''%s", reasonText, explanationText and '<br />' .. explanationText or '' ) } return makeMessageBox('mbox', mbargs) end -------------------------------------------------------------------------------- -- Padlock class -------------------------------------------------------------------------------- local Padlock = setmetatable({}, BannerTemplate) Padlock.__index = Padlock function Padlock.new(protectionObj, blurbObj, cfg) local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb. obj.imageSize = 'x20' -- 日本語版独自の変更: フィールド名、高さのみ指定 obj.imageCaption = blurbObj:makeBannerText('tooltip') obj._imageAlt = blurbObj:makeBannerText('alt') obj._imageLink = blurbObj:makeBannerText('link') obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action] or cfg.padlockIndicatorNames.default or 'pp-default' return setmetatable(obj, Padlock) end function Padlock:__tostring() local frame = mw.getCurrentFrame() -- The nowiki tag helps prevent whitespace at the top of articles. return frame:extensionTag{name = 'nowiki'} .. frame:extensionTag{ name = 'indicator', args = {name = self._indicatorName}, content = self:renderImage() } end -------------------------------------------------------------------------------- -- Exports -------------------------------------------------------------------------------- local p = {} function p._exportClasses() -- This is used for testing purposes. return { Protection = Protection, Blurb = Blurb, BannerTemplate = BannerTemplate, Banner = Banner, Padlock = Padlock, } end function p._main(args, cfg, title) args = args or {} cfg = cfg or require(CONFIG_MODULE) local protectionObj = Protection.new(args, cfg, title) local ret = {} -- If a page's edit protection is equally or more restrictive than its -- protection from some other action, then don't bother displaying anything -- for the other action (except categories). if protectionObj.action == 'edit' or args.demolevel or not getReachableNodes( cfg.hierarchy, protectionObj.level )[effectiveProtectionLevel('edit', protectionObj.title)] then -- Initialise the blurb object local blurbObj = Blurb.new(protectionObj, args, cfg) -- Render the banner if protectionObj:isProtected() then ret[#ret + 1] = tostring( (yesno(args.small) and Padlock or Banner) .new(protectionObj, blurbObj, cfg) ) end end -- Render the categories if yesno(args.category) ~= false then ret[#ret + 1] = protectionObj:makeCategoryLinks() end return table.concat(ret) end function p.main(frame, cfg) cfg = cfg or require(CONFIG_MODULE) -- Find default args, if any. local parent = frame.getParent and frame:getParent() local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub('/sandbox$', '')] -- Find user args, and use the parent frame if we are being called from a -- wrapper template. getArgs = getArgs or require('Module:Arguments').getArgs local userArgs = getArgs(frame, { parentOnly = defaultArgs, frameOnly = not defaultArgs }) -- Build the args table. User-specified args overwrite default args. local args = {} for k, v in pairs(defaultArgs or {}) do args[k] = v end for k, v in pairs(userArgs) do args[k] = v end return p._main(args, cfg) end return p 4bda59115ba9b006ed3d678013dc55d2ef567dfe モジュール:Message box/configuration 828 19 50 2023-03-07T15:54:33Z ja>ネイ 0 [[en:Module:Message box/configuration]] oldid=1097616239 より更新 Scribunto text/plain -------------------------------------------------------------------------------- -- Message box configuration -- -- -- -- This module contains configuration data for [[Module:Message box]]. -- -------------------------------------------------------------------------------- return { ambox = { types = { speedy = { class = 'ambox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'ambox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'ambox-content', image = 'Ambox important.svg' }, style = { class = 'ambox-style', image = 'Edit-clear.svg' }, move = { class = 'ambox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'ambox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'ambox-notice', image = 'Information icon4.svg' } }, default = 'notice', allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'}, allowSmall = true, smallParam = 'left', smallClass = 'mbox-small-left', substCheck = true, classes = {--[['metadata',]] 'ambox'}, imageEmptyCell = true, imageCheckBlank = true, imageSmallSize = '20x20px', imageCellDiv = true, useCollapsibleTextFields = true, imageRightNone = true, sectionDefault = '記事', allowMainspaceCategories = true, templateCategory = '記事メッセージボックス', templateCategoryRequireName = true, templateErrorCategory = 'パラメータ指定の無い記事メッセージボックス', templateErrorParamsToCheck = {'issue', 'fix', 'subst'}, templatestyles = 'Module:Message box/ambox.css' }, cmbox = { types = { speedy = { class = 'cmbox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'cmbox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'cmbox-content', image = 'Ambox important.svg' }, style = { class = 'cmbox-style', image = 'Edit-clear.svg' }, move = { class = 'cmbox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'cmbox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'cmbox-notice', image = 'Information icon4.svg' } }, default = 'notice', showInvalidTypeError = true, classes = {'cmbox'}, imageEmptyCell = true, templatestyles = 'Module:Message box/cmbox.css' }, fmbox = { types = { warning = { class = 'fmbox-warning', image = 'Ambox warning pn.svg' }, editnotice = { class = 'fmbox-editnotice', image = 'Information icon4.svg' }, system = { class = 'fmbox-system', image = 'Information icon4.svg' } }, default = 'system', showInvalidTypeError = true, classes = {'fmbox'}, imageEmptyCell = false, imageRightNone = false, templatestyles = 'Module:Message box/fmbox.css' }, imbox = { types = { speedy = { class = 'imbox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'imbox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'imbox-content', image = 'Ambox important.svg' }, style = { class = 'imbox-style', image = 'Edit-clear.svg' }, move = { class = 'imbox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'imbox-protection', image = 'Padlock-silver-medium.svg' }, license = { class = 'imbox-license licensetpl', image = 'Imbox license.png' -- @todo We need an SVG version of this }, featured = { class = 'imbox-featured', image = 'Cscr-featured.svg' }, notice = { class = 'imbox-notice', image = 'Information icon4.svg' } }, default = 'notice', showInvalidTypeError = true, classes = {'imbox'}, imageEmptyCell = true, below = true, templateCategory = 'ファイルメッセージボックス', templatestyles = 'Module:Message box/imbox.css' }, ombox = { types = { speedy = { class = 'ombox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'ombox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'ombox-content', image = 'Ambox important.svg' }, style = { class = 'ombox-style', image = 'Edit-clear.svg' }, move = { class = 'ombox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'ombox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'ombox-notice', image = 'Information icon4.svg' } }, default = 'notice', showInvalidTypeError = true, classes = {'ombox'}, allowSmall = true, imageEmptyCell = true, imageRightNone = true, templatestyles = 'Module:Message box/ombox.css' }, tmbox = { types = { speedy = { class = 'tmbox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'tmbox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'tmbox-content', image = 'Ambox important.svg' }, style = { class = 'tmbox-style', image = 'Edit-clear.svg' }, move = { class = 'tmbox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'tmbox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'tmbox-notice', image = 'Information icon4.svg' } }, default = 'notice', showInvalidTypeError = true, classes = {'tmbox'}, allowSmall = true, imageRightNone = true, imageEmptyCell = true, templateCategory = 'ノートページメッセージボックス', templatestyles = 'Module:Message box/tmbox.css' } } e22b1a5ebead175963172bf52fb102c8b826cd07 モジュール:Message box 828 17 46 2023-03-07T15:56:00Z ja>ネイ 0 [[en:Module:Message box]] oldid=1117705817 より更新 Scribunto text/plain require('strict') local getArgs local yesno = require('Module:Yesno') local lang = mw.language.getContentLanguage() local CONFIG_MODULE = 'Module:Message box/configuration' local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'} -------------------------------------------------------------------------------- -- Helper functions -------------------------------------------------------------------------------- local function getTitleObject(...) -- Get the title object, passing the function through pcall -- in case we are over the expensive function count limit. local success, title = pcall(mw.title.new, ...) if success then return title end end local function union(t1, t2) -- Returns the union of two arrays. local vals = {} for i, v in ipairs(t1) do vals[v] = true end for i, v in ipairs(t2) do vals[v] = true end local ret = {} for k in pairs(vals) do table.insert(ret, k) end table.sort(ret) return ret end local function getArgNums(args, prefix) local nums = {} for k, v in pairs(args) do local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$') if num then table.insert(nums, tonumber(num)) end end table.sort(nums) return nums end -------------------------------------------------------------------------------- -- Box class definition -------------------------------------------------------------------------------- local MessageBox = {} MessageBox.__index = MessageBox function MessageBox.new(boxType, args, cfg) args = args or {} local obj = {} -- Set the title object and the namespace. obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle() -- Set the config for our box type. obj.cfg = cfg[boxType] if not obj.cfg then local ns = obj.title.namespace -- boxType is "mbox" or invalid input if args.demospace and args.demospace ~= '' then -- implement demospace parameter of mbox local demospace = string.lower(args.demospace) if DEMOSPACES[demospace] then -- use template from DEMOSPACES obj.cfg = cfg[DEMOSPACES[demospace]] elseif string.find( demospace, 'talk' ) then -- demo as a talk page obj.cfg = cfg.tmbox else -- default to ombox obj.cfg = cfg.ombox end elseif ns == 0 then obj.cfg = cfg.ambox -- main namespace elseif ns == 6 then obj.cfg = cfg.imbox -- file namespace elseif ns == 14 then obj.cfg = cfg.cmbox -- category namespace else local nsTable = mw.site.namespaces[ns] if nsTable and nsTable.isTalk then obj.cfg = cfg.tmbox -- any talk namespace else obj.cfg = cfg.ombox -- other namespaces or invalid input end end end -- Set the arguments, and remove all blank arguments except for the ones -- listed in cfg.allowBlankParams. do local newArgs = {} for k, v in pairs(args) do if v ~= '' then newArgs[k] = v end end for i, param in ipairs(obj.cfg.allowBlankParams or {}) do newArgs[param] = args[param] end obj.args = newArgs end -- Define internal data structure. obj.categories = {} obj.classes = {} -- For lazy loading of [[Module:Category handler]]. obj.hasCategories = false return setmetatable(obj, MessageBox) end function MessageBox:addCat(ns, cat, sort) if not cat then return nil end if sort then cat = string.format('[[Category:%s|%s]]', cat, sort) else cat = string.format('[[Category:%s]]', cat) end self.hasCategories = true self.categories[ns] = self.categories[ns] or {} table.insert(self.categories[ns], cat) end function MessageBox:addClass(class) if not class then return nil end table.insert(self.classes, class) end function MessageBox:setParameters() local args = self.args local cfg = self.cfg -- Get type data. self.type = args.type local typeData = cfg.types[self.type] self.invalidTypeError = cfg.showInvalidTypeError and self.type and not typeData typeData = typeData or cfg.types[cfg.default] self.typeClass = typeData.class self.typeImage = typeData.image -- Find if the box has been wrongly substituted. self.isSubstituted = cfg.substCheck and args.subst == 'SUBST' -- Find whether we are using a small message box. self.isSmall = cfg.allowSmall and ( cfg.smallParam and args.small == cfg.smallParam or not cfg.smallParam and yesno(args.small) ) -- Add attributes, classes and styles. self.id = args.id self.name = args.name if self.name then self:addClass('box-' .. string.gsub(self.name,' ','_')) end if yesno(args.plainlinks) ~= false then self:addClass('plainlinks') end for _, class in ipairs(cfg.classes or {}) do self:addClass(class) end if self.isSmall then self:addClass(cfg.smallClass or 'mbox-small') end self:addClass(self.typeClass) self:addClass(args.class) self.style = args.style self.attrs = args.attrs -- Set text style. self.textstyle = args.textstyle -- Find if we are on the template page or not. This functionality is only -- used if useCollapsibleTextFields is set, or if both cfg.templateCategory -- and cfg.templateCategoryRequireName are set. self.useCollapsibleTextFields = cfg.useCollapsibleTextFields if self.useCollapsibleTextFields or cfg.templateCategory and cfg.templateCategoryRequireName then if self.name then local templateName = mw.ustring.match( self.name, '^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$' ) or self.name templateName = 'Template:' .. templateName self.templateTitle = getTitleObject(templateName) end self.isTemplatePage = self.templateTitle and mw.title.equals(self.title, self.templateTitle) end -- Process data for collapsible text fields. At the moment these are only -- used in {{ambox}}. if self.useCollapsibleTextFields then -- Get the self.issue value. if self.isSmall and args.smalltext then self.issue = args.smalltext else local sect if args.sect == '' then sect = 'This ' .. (cfg.sectionDefault or 'page') elseif type(args.sect) == 'string' then sect = 'This ' .. args.sect end local issue = args.issue issue = type(issue) == 'string' and issue ~= '' and issue or nil local text = args.text text = type(text) == 'string' and text or nil local issues = {} table.insert(issues, sect) table.insert(issues, issue) table.insert(issues, text) self.issue = table.concat(issues, ' ') end -- Get the self.talk value. local talk = args.talk -- Show talk links on the template page or template subpages if the talk -- parameter is blank. if talk == '' and self.templateTitle and ( mw.title.equals(self.templateTitle, self.title) or self.title:isSubpageOf(self.templateTitle) ) then talk = '#' elseif talk == '' then talk = nil end if talk then -- If the talk value is a talk page, make a link to that page. Else -- assume that it's a section heading, and make a link to the talk -- page of the current page with that section heading. local talkTitle = getTitleObject(talk) local talkArgIsTalkPage = true if not talkTitle or not talkTitle.isTalkPage then talkArgIsTalkPage = false talkTitle = getTitleObject( self.title.text, mw.site.namespaces[self.title.namespace].talk.id ) end if talkTitle and talkTitle.exists then local talkText if self.isSmall then local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk) talkText = string.format('([[%s|ノート]])', talkLink) else talkText = '関連議論は' if talkArgIsTalkPage then talkText = string.format( '%s[[%s|%s]]に存在するかもしれません。', talkText, talk, talkTitle.prefixedText ) else talkText = string.format( '%s[[%s#%s|ノートページ]]に存在するかもしれません。', talkText, talkTitle.prefixedText, talk ) end end self.talk = talkText end end -- Get other values. self.fix = args.fix ~= '' and args.fix or nil local date if args.date and args.date ~= '' then date = args.date elseif args.date == '' and self.isTemplatePage then date = lang:formatDate('Y年F') end if date then self.date = string.format("<span class='date-container'>(<span class='date'>%s</span>)</span>", date) end self.info = args.info if yesno(args.removalnotice) then self.removalNotice = cfg.removalNotice end end -- Set the non-collapsible text field. At the moment this is used by all box -- types other than ambox, and also by ambox when small=yes. if self.isSmall then self.text = args.smalltext or args.text else self.text = args.text end -- Set the below row. self.below = cfg.below and args.below -- General image settings. self.imageCellDiv = not self.isSmall and cfg.imageCellDiv self.imageEmptyCell = cfg.imageEmptyCell -- Left image settings. local imageLeft = self.isSmall and args.smallimage or args.image if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none' or not cfg.imageCheckBlank and imageLeft ~= 'none' then self.imageLeft = imageLeft if not imageLeft then local imageSize = self.isSmall and (cfg.imageSmallSize or '30x30px') or '40x40px' self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage or 'Imbox notice.png', imageSize) end end -- Right image settings. local imageRight = self.isSmall and args.smallimageright or args.imageright if not (cfg.imageRightNone and imageRight == 'none') then self.imageRight = imageRight end -- set templatestyles self.base_templatestyles = cfg.templatestyles self.templatestyles = args.templatestyles end function MessageBox:setMainspaceCategories() local args = self.args local cfg = self.cfg if not cfg.allowMainspaceCategories then return nil end local nums = {} for _, prefix in ipairs{'cat', 'category', 'all'} do args[prefix .. '1'] = args[prefix] nums = union(nums, getArgNums(args, prefix)) end -- The following is roughly equivalent to the old {{Ambox/category}}. local date = args.date date = type(date) == 'string' and date local preposition = '/' for _, num in ipairs(nums) do local mainCat = args['cat' .. tostring(num)] or args['category' .. tostring(num)] local allCat = args['all' .. tostring(num)] mainCat = type(mainCat) == 'string' and mainCat allCat = type(allCat) == 'string' and allCat if mainCat and date and date ~= '' then local catTitle = string.format('%s%s%s', mainCat, preposition, date) self:addCat(0, catTitle) catTitle = getTitleObject('Category:' .. catTitle) if not catTitle or not catTitle.exists then self:addCat(0, '貼り付け日が正しくないテンプレートのある記事') end elseif mainCat and (not date or date == '') then self:addCat(0, mainCat) end if allCat then self:addCat(0, allCat) end end end function MessageBox:setTemplateCategories() local args = self.args local cfg = self.cfg -- Add template categories. if cfg.templateCategory then if cfg.templateCategoryRequireName then if self.isTemplatePage then self:addCat(10, cfg.templateCategory) end elseif not self.title.isSubpage then self:addCat(10, cfg.templateCategory) end end -- Add template error categories. if cfg.templateErrorCategory then local templateErrorCategory = cfg.templateErrorCategory local templateCat, templateSort if not self.name and not self.title.isSubpage then templateCat = templateErrorCategory elseif self.isTemplatePage then local paramsToCheck = cfg.templateErrorParamsToCheck or {} local count = 0 for i, param in ipairs(paramsToCheck) do if not args[param] then count = count + 1 end end if count > 0 then templateCat = templateErrorCategory templateSort = tostring(count) end if self.categoryNums and #self.categoryNums > 0 then templateCat = templateErrorCategory templateSort = 'C' end end self:addCat(10, templateCat, templateSort) end end function MessageBox:setAllNamespaceCategories() -- Set categories for all namespaces. if self.invalidTypeError then local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText self:addCat('all', 'パラメータの修正が必要なメッセージボックス', allSort) end if self.isSubstituted then self:addCat('all', '正しく置き換えられていないテンプレートがあるページ') end end function MessageBox:setCategories() if self.title.namespace == 0 then self:setMainspaceCategories() elseif self.title.namespace == 10 then self:setTemplateCategories() end self:setAllNamespaceCategories() end function MessageBox:renderCategories() if not self.hasCategories then -- No categories added, no need to pass them to Category handler so, -- if it was invoked, it would return the empty string. -- So we shortcut and return the empty string. return "" end -- Convert category tables to strings and pass them through -- [[Module:Category handler]]. return require('Module:Category handler')._main{ main = table.concat(self.categories[0] or {}), template = table.concat(self.categories[10] or {}), all = table.concat(self.categories.all or {}), nocat = self.args.nocat, page = self.args.page } end function MessageBox:export() local root = mw.html.create() -- Add the subst check error. if self.isSubstituted and self.name then root:tag('b') :addClass('error') :wikitext(string.format( 'テンプレート<code>%s[[Template:%s|%s]]%s</code>が正しく置き換えられませんでした。', mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}') )) end local frame = mw.getCurrentFrame() root:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = self.base_templatestyles }, }) -- Add support for a single custom templatestyles sheet. Undocumented as -- need should be limited and many templates using mbox are substed; we -- don't want to spread templatestyles sheets around to arbitrary places if self.templatestyles then root:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = self.templatestyles }, }) end -- Create the box table. local boxTable = root:tag('table') boxTable:attr('id', self.id or nil) for i, class in ipairs(self.classes or {}) do boxTable:addClass(class or nil) end boxTable :cssText(self.style or nil) :attr('role', 'presentation') if self.attrs then boxTable:attr(self.attrs) end -- Add the left-hand image. local row = boxTable:tag('tr') if self.imageLeft then local imageLeftCell = row:tag('td'):addClass('mbox-image') if self.imageCellDiv then -- If we are using a div, redefine imageLeftCell so that the image -- is inside it. Divs use style="width: 52px;", which limits the -- image width to 52px. If any images in a div are wider than that, -- they may overlap with the text or cause other display problems. imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div') end imageLeftCell:wikitext(self.imageLeft or nil) elseif self.imageEmptyCell then -- Some message boxes define an empty cell if no image is specified, and -- some don't. The old template code in templates where empty cells are -- specified gives the following hint: "No image. Cell with some width -- or padding necessary for text cell to have 100% width." row:tag('td') :addClass('mbox-empty-cell') end -- Add the text. local textCell = row:tag('td'):addClass('mbox-text') if self.useCollapsibleTextFields then -- The message box uses advanced text parameters that allow things to be -- collapsible. At the moment, only ambox uses this. textCell:cssText(self.textstyle or nil) local textCellDiv = textCell:tag('div') textCellDiv :addClass('mbox-text-span') :wikitext(self.issue or nil) if (self.talk or self.fix) then textCellDiv:tag('span') :addClass('hide-when-compact') :wikitext(self.talk and (self.talk) or nil) :wikitext(self.fix and (self.fix) or nil) end textCellDiv:wikitext(self.date or nil) if self.info and not self.isSmall then textCellDiv :tag('span') :addClass('hide-when-compact') :wikitext(self.info and (' ' .. self.info) or nil) end if self.removalNotice then textCellDiv:tag('span') :addClass('hide-when-compact') :tag('i') :wikitext(string.format(" (%s)", self.removalNotice)) end else -- Default text formatting - anything goes. textCell :cssText(self.textstyle or nil) :wikitext(self.text or nil) end -- Add the right-hand image. if self.imageRight then local imageRightCell = row:tag('td'):addClass('mbox-imageright') if self.imageCellDiv then -- If we are using a div, redefine imageRightCell so that the image -- is inside it. imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div') end imageRightCell :wikitext(self.imageRight or nil) end -- Add the below row. if self.below then boxTable:tag('tr') :tag('td') :attr('colspan', self.imageRight and '3' or '2') :addClass('mbox-text') :cssText(self.textstyle or nil) :wikitext(self.below or nil) end -- Add error message for invalid type parameters. if self.invalidTypeError then root:tag('div') :addClass('mbox-invalid-type') :wikitext(string.format( 'このメッセージボックスには無効な"type=%s"というパラメータが指定されているため修正が必要です。', self.type or '' )) end -- Add categories. root:wikitext(self:renderCategories() or nil) return tostring(root) end -------------------------------------------------------------------------------- -- Exports -------------------------------------------------------------------------------- local p, mt = {}, {} function p._exportClasses() -- For testing. return { MessageBox = MessageBox } end function p.main(boxType, args, cfgTables) local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE)) box:setParameters() box:setCategories() return box:export() end function mt.__index(t, k) return function (frame) if not getArgs then getArgs = require('Module:Arguments').getArgs end return t.main(k, getArgs(frame, {trim = false, removeBlanks = false})) end end return setmetatable(p, mt) 7a56bb4b6a0d077d0f3a07b71c8ca29282e6273a モジュール:Message box/ombox.css 828 44 100 2023-03-15T05:59:35Z ja>ネイ 0 テキストサイズを戻す text text/plain /* {{pp-template}} */ .ombox { margin: 4px 0; border-collapse: collapse; border: 1px solid #a2a9b1; /* Default "notice" gray */ background-color: #f8f9fa; box-sizing: border-box; } /* For the "small=yes" option. */ .ombox.mbox-small { font-size: 88%; line-height: 1.25em; } .ombox-speedy { border: 2px solid #b32424; /* Red */ background-color: #fee7e6; /* Pink */ } .ombox-delete { border: 2px solid #b32424; /* Red */ } .ombox-content { border: 1px solid #f28500; /* Orange */ } .ombox-style { border: 1px solid #fc3; /* Yellow */ } .ombox-move { border: 1px solid #9932cc; /* Purple */ } .ombox-protection { border: 2px solid #a2a9b1; /* Gray-gold */ } .ombox .mbox-text { border: none; /* @noflip */ padding: 0.25em 0.9em; width: 100%; font-size: 90%; } .ombox .mbox-image { border: none; /* @noflip */ padding: 2px 0 2px 0.9em; text-align: center; } .ombox .mbox-imageright { border: none; /* @noflip */ padding: 2px 0.9em 2px 0; text-align: center; } /* An empty narrow cell */ .ombox .mbox-empty-cell { border: none; padding: 0; width: 1px; } .ombox .mbox-invalid-type { text-align: center; } @media (min-width: 720px) { .ombox { margin: 4px 10%; } .ombox.mbox-small { /* @noflip */ clear: right; /* @noflip */ float: right; /* @noflip */ margin: 4px 0 4px 1em; width: 238px; } } /* [[Category:テンプレートスタイル]] */ aa83107d45d02063755df2eb5da51209ba058027 テンプレート:Lua 10 41 94 2023-03-25T16:29:30Z ja>えのきだたもつ 0 「[[Template:Lua]]」を保護しました: [[WP:HRT|影響が特に大きいテンプレート]] ([編集=自動承認された利用者のみ許可] (無期限) [移動=自動承認された利用者のみ許可] (無期限)) wikitext text/x-wiki <includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude> {{Documentation}} </noinclude> 8797a825a10cd0b3c371fd4d94209ea095258122 テンプレート:N/a 10 70 152 2023-10-19T05:57:10Z ja>Nrliw 0 rv wikitext text/x-wiki <noinclude>{|class=wikitable |</noinclude><onlyinclude>style="background:#ececec;color:#2c2c2c;vertical-align:middle;font-size:smaller;text-align:{{{align|center}}};{{{style|}}}" class="table-na"|{{{1|N/A}}}</onlyinclude><noinclude> |}{{Documentation}}</noinclude> 4c6b5add89ae854fa9cfa8f8417928f4608b49a6 モジュール:List 828 22 56 2023-11-20T04:23:57Z ja>ネイ 0 start引数が機能していないため修正 Scribunto text/plain local libUtil = require('libraryUtil') local checkType = libUtil.checkType local mTableTools = require('Module:TableTools') local p = {} local listTypes = { ['bulleted'] = true, ['unbulleted'] = true, ['horizontal'] = true, ['ordered'] = true, ['horizontal_ordered'] = true } function p.makeListData(listType, args) -- Constructs a data table to be passed to p.renderList. local data = {} -- Classes and TemplateStyles data.classes = {} data.templatestyles = '' if listType == 'horizontal' or listType == 'horizontal_ordered' then table.insert(data.classes, 'hlist') data.templatestyles = mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = 'Hlist/styles.css' } } elseif listType == 'unbulleted' then table.insert(data.classes, 'plainlist') data.templatestyles = mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = 'Plainlist/styles.css' } } end table.insert(data.classes, args.class) -- Main div style data.style = args.style -- Indent for horizontal lists if listType == 'horizontal' or listType == 'horizontal_ordered' then local indent = tonumber(args.indent) indent = indent and indent * 1.6 or 0 if indent > 0 then data.marginLeft = indent .. 'em' end end -- List style types for ordered lists -- This could be "1, 2, 3", "a, b, c", or a number of others. The list style -- type is either set by the "type" attribute or the "list-style-type" CSS -- property. if listType == 'ordered' or listType == 'horizontal_ordered' then data.listStyleType = args.list_style_type or args['list-style-type'] data.type = args['type'] -- Detect invalid type attributes and attempt to convert them to -- list-style-type CSS properties. if data.type and not data.listStyleType and not tostring(data.type):find('^%s*[1AaIi]%s*$') then data.listStyleType = data.type data.type = nil end end -- List tag type if listType == 'ordered' or listType == 'horizontal_ordered' then data.listTag = 'ol' else data.listTag = 'ul' end -- Start number for ordered lists data.start = args.start if listType == 'horizontal_ordered' then -- Apply fix to get start numbers working with horizontal ordered lists. local startNum = tonumber(data.start) if startNum then data.counterReset = 'listitem ' .. tostring(startNum) data.counterIncrement = 'listitem -1' end end -- List style -- ul_style and ol_style are included for backwards compatibility. No -- distinction is made for ordered or unordered lists. data.listStyle = args.list_style -- List items -- li_style is included for backwards compatibility. item_style was included -- to be easier to understand for non-coders. data.itemStyle = args.item_style or args.li_style data.items = {} for _, num in ipairs(mTableTools.numKeys(args)) do local item = {} item.content = args[num] item.style = args['item' .. tostring(num) .. '_style'] or args['item_style' .. tostring(num)] item.value = args['item' .. tostring(num) .. '_value'] or args['item_value' .. tostring(num)] if item.value ~= nil then item.style = 'counter-reset: listitem ' .. item.value .. ';counter-increment: none;' .. ((item.style) or '') end table.insert(data.items, item) end return data end function p.renderList(data) -- Renders the list HTML. -- Return the blank string if there are no list items. if type(data.items) ~= 'table' or #data.items < 1 then return '' end -- Render the main div tag. local root = mw.html.create('div') for _, class in ipairs(data.classes or {}) do root:addClass(class) end root:css{['margin-left'] = data.marginLeft} if data.style then root:cssText(data.style) end -- Render the list tag. local list = root:tag(data.listTag or 'ul') list :attr{start = data.start, type = data.type} :css{ ['counter-reset'] = data.counterReset, ['counter-increment'] = data.counterIncrement, ['list-style-type'] = data.listStyleType } if data.listStyle then list:cssText(data.listStyle) end -- Render the list items for _, t in ipairs(data.items or {}) do local item = list:tag('li') if data.itemStyle then item:cssText(data.itemStyle) end if t.style then item:cssText(t.style) end item :attr{value = t.value} :wikitext(t.content) end return data.templatestyles .. tostring(root) end function p.renderTrackingCategories(args) local isDeprecated = false -- Tracks deprecated parameters. for k, v in pairs(args) do k = tostring(k) if k:find('^item_style%d+$') or k:find('^item_value%d+$') then isDeprecated = true break end end local ret = '' if isDeprecated then ret = ret .. '[[Category:List templates with deprecated parameters]]' end return ret end function p.makeList(listType, args) if not listType or not listTypes[listType] then error(string.format( "bad argument #1 to 'makeList' ('%s' is not a valid list type)", tostring(listType) ), 2) end checkType('makeList', 2, args, 'table') local data = p.makeListData(listType, args) local list = p.renderList(data) local trackingCategories = p.renderTrackingCategories(args) return list .. trackingCategories end for listType in pairs(listTypes) do p[listType] = function (frame) local mArguments = require('Module:Arguments') local origArgs = mArguments.getArgs(frame, { valueFunc = function (key, value) if not value or not mw.ustring.find(value, '%S') then return nil end if mw.ustring.find(value, '^%s*[%*#;:]') then return value else return value:match('^%s*(.-)%s*$') end return nil end }) -- Copy all the arguments to a new table, for faster indexing. local args = {} for k, v in pairs(origArgs) do args[k] = v end return p.makeList(listType, args) end end return p 355dc4095d8b21f2bc6715f5240f1eb4ae87e63b メインページ 0 1 1 2024-02-06T22:23:15Z MediaWiki default 1 Mirahezeへようこそ! wikitext text/x-wiki __NOTOC__ == {{SITENAME}}へようこそ! == このメインページはWiki作成者(リクエストによってこのWikiを作成したボランティア)によって自動的に作成されましたが、まだ置き換え作業が終わっていないようです。 === このWikiの管理者へ === こんにちは、あなたの新しいWikiへようこそ! WikiのホスティングにMirahezeを選択していただきありがとうございます。ホスティングでお役に立てるようでしたら幸いです。 今すぐ、あるいはご都合がよいときにいつでもWikiの作業を開始してください。 なにかお困りですか? お任せください。必要な点はWikiでサポートを受けられます。ご参考までに、MediaWikiの操作説明についていくつかリンクを追加しましたのでご参照ください。 * [[mw:Special:MyLanguage/Help:Contents| MediaWikiガイド (例:ナビゲーション、編集、ページ削除、利用者ブロック)]] * [[meta:Special:MyLanguage/FAQ|Miraheze よくある質問]] * [[meta:Special:MyLanguage/Request features|あなたのWikiの設定変更をリクエスト]]を参照してください。(拡張機能、スキン、ロゴ/Faviconの変更は、あなたのWikiの[[Special:ManageWiki]]を通じて行う必要があります。詳細は[[meta:Special:MyLanguage/ManageWiki|ManageWiki]]を参照してください) ==== ●●がわからないんですけど! ==== 大丈夫ですよ。説明文・よくある質問で説明していない場合でも、お手伝いはお任せください。ご連絡は下記までどうぞ。 * [[meta:Special:MyLanguage/Help center|Miraheze専用Wiki]] * [[phab:|Phabricator]] * [https://miraheze.org/discord Discord] * irc.libera.chat にある #miraheze チャットルーム ([irc://irc.libera.chat/%23miraheze 直接リンク]; [https://web.libera.chat/?channel=#miraheze ウェブチャット]) === このWikiを訪問された皆さんへ === ようこそ、現在、このWikiは仮のメインページ(このページ表示のこと)ですが、もうすぐこのウィキのビューロクラットが本番用に置換する見込みです。作業が終わり次第、更新されますので、また後でアクセスしてご確認くださるようお願いします。 dfe8481e86bcf55f13b917cb98976339f9514bb2 4 1 2024-02-07T06:43:10Z Kyushujin 2 内容を「== Scratch架空鉄道Wikiへようこそ! == このWikiは、Scratchで運営されている架空鉄道をまとめるWikiです。 どなたでも編集できます。」で置換 wikitext text/x-wiki == Scratch架空鉄道Wikiへようこそ! == このWikiは、Scratchで運営されている架空鉄道をまとめるWikiです。 どなたでも編集できます。 b0bc3efaca6e5e425d40648561343d90819dff18 5 4 2024-02-07T07:00:17Z Kyushujin 2 wikitext text/x-wiki == Scratch架空鉄道Wikiへようこそ! == このWikiは、Scratchで運営されている架空鉄道をまとめるWikiです。 どなたでも編集できます。 ==禁止行為== *荒らし行為(ページの白紙化、無意味なページの作成など) *Wiki運営に支障が出る行為 7af2e1478814d397c84e997a98a094ab556ad04f 9 5 2024-02-07T07:27:53Z Kyushujin 2 wikitext text/x-wiki == Scratch架空鉄道Wikiへようこそ! == このWikiは、Scratchで運営されている架空鉄道をまとめるWikiです。 どなたでも編集できます。 ==禁止行為== *荒らし行為(ページの白紙化、無意味なページの作成など) *Wiki運営に支障が出る行為 ==主要ページ== *[[架空鉄道一覧]] e087fe68c32616dc190e6bfce7dd65e4f70c53e8 12 9 2024-02-07T10:54:26Z Kyushujin 2 wikitext text/x-wiki == Scratch架空鉄道Wikiへようこそ! == このWikiは、Scratchで運営されている架空鉄道をまとめるWikiです。 どなたでも編集できます。 ==禁止行為== *荒らし行為(ページの白紙化、無意味なページの作成など) *Wiki運営に支障が出る行為 ==編集者の方へ== 記事は常体(~である)で書くようお願いいたします。 ==主要ページ== *[[架空鉄道一覧]] 7bbf89bc592c7a1b7b7cbabdf3add631fbb718cb SR 0 3 6 2024-02-07T07:04:28Z Kyushujin 2 ページの作成:「SRは、[[蒼原県]][[理間咲市]]に本社を置く鉄道事業者。蒼原県内に5路線を保有している。 ==路線== ===SR本線=== [[Scratch中央駅]]から[[理間咲駅]]までの路線。 ===博物館線=== [[ゴボ大学駅]]から[[Scratch鉄道博物館駅]]までの路線。 ===地平線=== [[氷原駅]]から[[海原駅]]までの路線。 読みは「ちだいらせん」。 ===上野線=== [[大矢口駅]]から[[上野駅]]までの路線…」 wikitext text/x-wiki SRは、[[蒼原県]][[理間咲市]]に本社を置く鉄道事業者。蒼原県内に5路線を保有している。 ==路線== ===SR本線=== [[Scratch中央駅]]から[[理間咲駅]]までの路線。 ===博物館線=== [[ゴボ大学駅]]から[[Scratch鉄道博物館駅]]までの路線。 ===地平線=== [[氷原駅]]から[[海原駅]]までの路線。 読みは「ちだいらせん」。 ===上野線=== [[大矢口駅]]から[[上野駅]]までの路線。 ===大良線=== [[多穂駅]]から[[下江津・大良駅]]までの路線。 ==リンク== スタジオ:https://scratch.mit.edu/studios/25848980/ 3468be6ea29a156b70152ecf822898e1c5fab74d 13 6 2024-02-07T14:49:55Z Kyushujin 2 wikitext text/x-wiki SRは、[[蒼原県]][[理間咲市]]に本社を置く鉄道事業者。蒼原県内に5路線を保有している。 ==路線== ===SR本線=== 「[[SR本線]]」も参照 [[Scratch中央駅]]から[[理間咲駅]]までの路線。 ===博物館線=== 「[[博物館線]]」も参照 [[ゴボ大学駅]]から[[Scratch鉄道博物館駅]]までの路線。 ===地平線=== 「[[地平線]]」も参照 [[氷原駅]]から[[海原駅]]までの路線。 読みは「ちだいらせん」。 ===上野線=== 「[[上野線]]」も参照 [[大矢口駅]]から[[上野駅]]までの路線。 ===大良線=== 「[[大良線]]」も参照 [[多穂駅]]から[[下江津・大良駅]]までの路線。 ==車両== ===SR1000系=== ===SR2000系=== ===SR4000系=== ===SR5000系=== ===導入予定の車両=== ====SR6000系==== ===過去の車両=== ====415系==== ==リンク== スタジオ:https://scratch.mit.edu/studios/25848980/ 4711dfcd00d62417465177336301a2b4444cf4e8 14 13 2024-02-07T14:50:13Z Kyushujin 2 wikitext text/x-wiki SRは、[[蒼原県]][[理間咲市]]に本社を置く鉄道事業者。蒼原県内に5路線を保有している。 ==路線== ===SR本線=== 「[[SR本線]]」も参照<br> [[Scratch中央駅]]から[[理間咲駅]]までの路線。 ===博物館線=== 「[[博物館線]]」も参照<br> [[ゴボ大学駅]]から[[Scratch鉄道博物館駅]]までの路線。 ===地平線=== 「[[地平線]]」も参照<br> [[氷原駅]]から[[海原駅]]までの路線。 読みは「ちだいらせん」。 ===上野線=== 「[[上野線]]」も参照<br> [[大矢口駅]]から[[上野駅]]までの路線。 ===大良線=== 「[[大良線]]」も参照<br> [[多穂駅]]から[[下江津・大良駅]]までの路線。 ==車両== ===SR1000系=== ===SR2000系=== ===SR4000系=== ===SR5000系=== ===導入予定の車両=== ====SR6000系==== ===過去の車両=== ====415系==== ==リンク== スタジオ:https://scratch.mit.edu/studios/25848980/ 676036c136636a3e6565653913fc7e9d1e5f2c4f 16 14 2024-02-08T07:35:04Z Kyushujin 2 wikitext text/x-wiki SRは、[[蒼原県]][[理間咲市]]に本社を置く鉄道事業者。蒼原県内に5路線を保有している。 ==路線== ===SR本線=== 「[[SR本線]]」も参照<br> [[Scratch中央駅]]から[[理間咲駅]]までの路線。 ===博物館線=== 「[[博物館線]]」も参照<br> [[ゴボ大学駅]]から[[Scratch鉄道博物館駅]]までの路線。 ===地平線=== 「[[地平線]]」も参照<br> [[氷原駅]]から[[海原駅]]までの路線。 読みは「ちだいらせん」。 ===上野線=== 「[[上野線]]」も参照<br> [[大矢口駅]]から[[上野駅]]までの路線。 ===大良線=== 「[[大良線]]」も参照<br> [[多穂駅]]から[[下江津・大良駅]]までの路線。 ==車両== ===SR1000系=== 2020年に登場した交流通勤型電車。 片側両開き3扉の20m車体。 [[SR#SR2000系|SR2000系]]による置き換えが進んでおり、現在運用についているのは1編成のみとなっている。 2024年3月に引退する予定。 *編成:4両 *軌間:1067mm *電気方式:交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席:全席ロングシート *車体長:20m ===SR2000系=== 2020年に登場した交直流通勤型電車。 片側両開き4扉の20m車体。 *編成:4,6,8両(0番台6両,50番台8両,70·80番台4両) *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席 **全席ロングシート(0·50·70番台) **車端部のみボックスシート(80番台) *車体長:20m ===SR4000系=== 2020年に登場した交直流急行型電車。 片側両開き2扉の20m車体。 *編成:4,6両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席:回転クロスシート *車体長:20m ===SR5000系=== 2023年に登場した交直流通勤型電車。 片側両開き3扉の20m車体。 *編成:8両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:160km/h *座席:ロングシート *車体長:20m ==10000系== ===導入予定の車両=== ====SR6000系==== ===過去の車両=== ====415系==== ==リンク== スタジオ:https://scratch.mit.edu/studios/25848980/ e8a75fb4e7cca49d6db343f64acd0de6131b6ea2 17 16 2024-02-08T11:29:51Z Kyushujin 2 wikitext text/x-wiki SRは、[[蒼原県]][[理間咲市]]に本社を置く鉄道事業者。蒼原県内に5路線を保有している。 ==路線== ===SR本線=== 「[[SR本線]]」も参照<br> [[Scratch中央駅]]から[[理間咲駅]]までの路線。 ===博物館線=== 「[[博物館線]]」も参照<br> [[ゴボ大学駅]]から[[Scratch鉄道博物館駅]]までの路線。 ===地平線=== 「[[地平線]]」も参照<br> [[氷原駅]]から[[海原駅]]までの路線。 読みは「ちだいらせん」。 ===上野線=== 「[[上野線]]」も参照<br> [[大矢口駅]]から[[上野駅]]までの路線。 ===大良線=== 「[[大良線]]」も参照<br> [[多穂駅]]から[[下江津・大良駅]]までの路線。 ==車両== ===SR1000系=== 2020年に登場した交流通勤型電車。 片側両開き3扉の20m車体。<br> [[SR#SR2000系|SR2000系]]による置き換えが進んでおり、現在運用についているのは1編成のみとなっている。 2024年3月に引退する予定。 *編成:4両 *軌間:1067mm *電気方式:交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席:全席ロングシート *車体長:20m ===SR2000系=== 2020年に登場した交直流通勤型電車。 片側両開き4扉の20m車体。 *編成:4,6,8両(0番台6両,50番台8両,70·80番台4両) *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席 **全席ロングシート(0·50·70番台) **車端部のみボックスシート(80番台) *車体長:20m ===SR4000系=== 2020年に登場した交直流急行型電車。 片側両開き2扉の20m車体。 *編成:4,6両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席:回転クロスシート *車体長:20m ===SR5000系=== 2023年に登場した交直流通勤型電車。 片側両開き3扉の20m車体。 *編成:8両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:160km/h *座席:ロングシート *車体長:20m ==10000系== ===導入予定の車両=== ====SR6000系==== ===過去の車両=== ====415系==== ==リンク== スタジオ:https://scratch.mit.edu/studios/25848980/ 0feeb966b5b082a71660fcc9c9e6c4df203d995d 18 17 2024-02-08T14:09:19Z Kyushujin 2 wikitext text/x-wiki SRは、[[蒼原県]][[理間咲市]]に本社を置く鉄道事業者。蒼原県内に5路線を保有している。 ==路線== ===SR本線=== 「[[SR本線]]」も参照<br> [[Scratch中央駅]]から[[理間咲駅]]までの路線。 ===博物館線=== 「[[博物館線]]」も参照<br> [[ゴボ大学駅]]から[[Scratch鉄道博物館駅]]までの路線。 ===地平線=== 「[[地平線]]」も参照<br> [[氷原駅]]から[[海原駅]]までの路線。 読みは「ちだいらせん」。 ===上野線=== 「[[上野線]]」も参照<br> [[大矢口駅]]から[[上野駅]]までの路線。 ===大良線=== 「[[大良線]]」も参照<br> [[多穂駅]]から[[下江津・大良駅]]までの路線。 ==車両== ===SR1000系=== 2020年に登場した交流通勤型電車。 片側両開き3扉の20m車体。<br> [[SR#SR2000系|SR2000系]]による置き換えが進んでおり、現在運用についているのは1編成のみとなっている。 2024年3月に引退する予定。 *編成:4両 *軌間:1067mm *電気方式:交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席:全席ロングシート *車体長:20m ===SR2000系=== 2020年に登場した交直流通勤型電車。 片側両開き4扉の20m車体。 *編成:4,6,8両(0番台6両,50番台8両,70·80番台4両) *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席 **全席ロングシート(0·50·70番台) **車端部のみボックスシート(80番台) *車体長:20m ===SR4000系=== 2020年に登場した交直流急行型電車。 片側両開き2扉の20m車体。 *編成:4,6両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席:回転クロスシート *車体長:20m ===SR5000系=== 2023年に登場した交直流通勤型電車。 片側両開き3扉の20m車体。 *編成:8両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:160km/h *座席:ロングシート *車体長:20m ==10000系== 2023年に運用開始した[[平宮鉄道]]からの譲渡車両。2020年にはすでに車両基地に搬入されていたが、諸事情により運用開始が遅れた。 *編成:4両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:160km/h *座席 **セミクロスシート(先頭車) **ロングシート(中間車) *車体長:20m ===415系=== 2020年に運用を開始した某社からの譲渡車両。3編成が譲渡されたが、現在は1編成のみ在籍している。<br> その編成は現在[[SRタユテ]]に貸し出し中である。そのため、定期運用にはついていない。 ===導入予定の車両=== ====SR6000系==== 2024年夏に登場予定の車両。座席はSR初のデュアルシートととなっている。 *編成:6両 *軌間:1067mm *電気方式:交流20000V *最高運転速度:100km/h *設計最高速度:120km/h *座席:デュアルシート *車体長:20m ==リンク== スタジオ:https://scratch.mit.edu/studios/25848980/ 0ace282e80ac9ee29630e374063bfba167bcf710 19 18 2024-02-08T14:09:46Z Kyushujin 2 wikitext text/x-wiki SRは、[[蒼原県]][[理間咲市]]に本社を置く鉄道事業者。蒼原県内に5路線を保有している。 ==路線== ===SR本線=== 「[[SR本線]]」も参照<br> [[Scratch中央駅]]から[[理間咲駅]]までの路線。 ===博物館線=== 「[[博物館線]]」も参照<br> [[ゴボ大学駅]]から[[Scratch鉄道博物館駅]]までの路線。 ===地平線=== 「[[地平線]]」も参照<br> [[氷原駅]]から[[海原駅]]までの路線。 読みは「ちだいらせん」。 ===上野線=== 「[[上野線]]」も参照<br> [[大矢口駅]]から[[上野駅]]までの路線。 ===大良線=== 「[[大良線]]」も参照<br> [[多穂駅]]から[[下江津・大良駅]]までの路線。 ==車両== ===SR1000系=== 2020年に登場した交流通勤型電車。 片側両開き3扉の20m車体。<br> [[SR#SR2000系|SR2000系]]による置き換えが進んでおり、現在運用についているのは1編成のみとなっている。 2024年3月に引退する予定。 *編成:4両 *軌間:1067mm *電気方式:交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席:全席ロングシート *車体長:20m ===SR2000系=== 2020年に登場した交直流通勤型電車。 片側両開き4扉の20m車体。 *編成:4,6,8両(0番台6両,50番台8両,70·80番台4両) *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席 **全席ロングシート(0·50·70番台) **車端部のみボックスシート(80番台) *車体長:20m ===SR4000系=== 2020年に登場した交直流急行型電車。 片側両開き2扉の20m車体。 *編成:4,6両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席:回転クロスシート *車体長:20m ===SR5000系=== 2023年に登場した交直流通勤型電車。 片側両開き3扉の20m車体。 *編成:8両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:160km/h *座席:ロングシート *車体長:20m ===10000系=== 2023年に運用開始した[[平宮鉄道]]からの譲渡車両。2020年にはすでに車両基地に搬入されていたが、諸事情により運用開始が遅れた。 *編成:4両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:160km/h *座席 **セミクロスシート(先頭車) **ロングシート(中間車) *車体長:20m ===415系=== 2020年に運用を開始した某社からの譲渡車両。3編成が譲渡されたが、現在は1編成のみ在籍している。<br> その編成は現在[[SRタユテ]]に貸し出し中である。そのため、定期運用にはついていない。 ===導入予定の車両=== ====SR6000系==== 2024年夏に登場予定の車両。座席はSR初のデュアルシートととなっている。 *編成:6両 *軌間:1067mm *電気方式:交流20000V *最高運転速度:100km/h *設計最高速度:120km/h *座席:デュアルシート *車体長:20m ==リンク== スタジオ:https://scratch.mit.edu/studios/25848980/ f1445bde4ca9f9ea3d8d659381ead95bc12d46c9 20 19 2024-02-08T14:19:13Z Kyushujin 2 wikitext text/x-wiki SRは、[[蒼原県]][[理間咲市]]に本社を置く鉄道事業者。蒼原県内に5路線を保有している。 ==路線== *[[SR本線]]([[Scratch中央駅]]~[[理間咲駅]]) *[[博物館線]]([[ゴボ大学駅]]~[[Scratch鉄道博物館駅]]) *[[地平線]]([[氷原駅]]~[[海原駅]) *[[上野線]]([[大矢口駅]]~[[上野駅]]) *[[大良線]]([[多穂駅]]~[[下江津・大良駅]] ==車両== ===SR1000系=== 2020年に登場した交流通勤型電車。 片側両開き3扉の20m車体。<br> [[SR#SR2000系|SR2000系]]による置き換えが進んでおり、現在運用についているのは1編成のみとなっている。 2024年3月に引退する予定。 *編成:4両 *軌間:1067mm *電気方式:交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席:全席ロングシート *車体長:20m ===SR2000系=== 2020年に登場した交直流通勤型電車。 片側両開き4扉の20m車体。 *編成:4,6,8両(0番台6両,50番台8両,70·80番台4両) *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席 **全席ロングシート(0·50·70番台) **車端部のみボックスシート(80番台) *車体長:20m ===SR4000系=== 2020年に登場した交直流急行型電車。 片側両開き2扉の20m車体。 *編成:4,6両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席:回転クロスシート *車体長:20m ===SR5000系=== 2023年に登場した交直流通勤型電車。 片側両開き3扉の20m車体。 *編成:8両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:160km/h *座席:ロングシート *車体長:20m ===10000系=== 2023年に運用開始した[[平宮鉄道]]からの譲渡車両。2020年にはすでに車両基地に搬入されていたが、諸事情により運用開始が遅れた。 *編成:4両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:160km/h *座席 **セミクロスシート(先頭車) **ロングシート(中間車) *車体長:20m ===415系=== 2020年に運用を開始した某社からの譲渡車両。3編成が譲渡されたが、現在は1編成のみ在籍している。<br> その編成は現在[[SRタユテ]]に貸し出し中である。そのため、定期運用にはついていない。 ===導入予定の車両=== ====SR6000系==== 2024年夏に登場予定の車両。座席はSR初のデュアルシートととなっている。 *編成:6両 *軌間:1067mm *電気方式:交流20000V *最高運転速度:100km/h *設計最高速度:120km/h *座席:デュアルシート *車体長:20m ==リンク== スタジオ:https://scratch.mit.edu/studios/25848980/ d0bc126e8cff933fb63d234995dec607b623033e 21 20 2024-02-08T14:19:25Z Kyushujin 2 /* 路線 */ wikitext text/x-wiki SRは、[[蒼原県]][[理間咲市]]に本社を置く鉄道事業者。蒼原県内に5路線を保有している。 ==路線== *[[SR本線]]([[Scratch中央駅]]~[[理間咲駅]]) *[[博物館線]]([[ゴボ大学駅]]~[[Scratch鉄道博物館駅]]) *[[地平線]]([[氷原駅]]~[[海原駅]]) *[[上野線]]([[大矢口駅]]~[[上野駅]]) *[[大良線]]([[多穂駅]]~[[下江津・大良駅]] ==車両== ===SR1000系=== 2020年に登場した交流通勤型電車。 片側両開き3扉の20m車体。<br> [[SR#SR2000系|SR2000系]]による置き換えが進んでおり、現在運用についているのは1編成のみとなっている。 2024年3月に引退する予定。 *編成:4両 *軌間:1067mm *電気方式:交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席:全席ロングシート *車体長:20m ===SR2000系=== 2020年に登場した交直流通勤型電車。 片側両開き4扉の20m車体。 *編成:4,6,8両(0番台6両,50番台8両,70·80番台4両) *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席 **全席ロングシート(0·50·70番台) **車端部のみボックスシート(80番台) *車体長:20m ===SR4000系=== 2020年に登場した交直流急行型電車。 片側両開き2扉の20m車体。 *編成:4,6両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:100km/h *座席:回転クロスシート *車体長:20m ===SR5000系=== 2023年に登場した交直流通勤型電車。 片側両開き3扉の20m車体。 *編成:8両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:160km/h *座席:ロングシート *車体長:20m ===10000系=== 2023年に運用開始した[[平宮鉄道]]からの譲渡車両。2020年にはすでに車両基地に搬入されていたが、諸事情により運用開始が遅れた。 *編成:4両 *軌間:1067mm *電気方式:直流1500V/交流20000V *最高運転速度:100km/h *設計最高速度:160km/h *座席 **セミクロスシート(先頭車) **ロングシート(中間車) *車体長:20m ===415系=== 2020年に運用を開始した某社からの譲渡車両。3編成が譲渡されたが、現在は1編成のみ在籍している。<br> その編成は現在[[SRタユテ]]に貸し出し中である。そのため、定期運用にはついていない。 ===導入予定の車両=== ====SR6000系==== 2024年夏に登場予定の車両。座席はSR初のデュアルシートととなっている。 *編成:6両 *軌間:1067mm *電気方式:交流20000V *最高運転速度:100km/h *設計最高速度:120km/h *座席:デュアルシート *車体長:20m ==リンク== スタジオ:https://scratch.mit.edu/studios/25848980/ 2cc84c21f71ea7509200ad11c1d8d00aff8418f7 利用者:Kyushujin 2 4 7 2024-02-07T07:08:24Z Kyushujin 2 ページの作成:「このWikiの管理人です。」 wikitext text/x-wiki このWikiの管理人です。 0f5e44d4ff45e5e26669789f2f1a8fc292525a6e 10 7 2024-02-07T09:46:04Z Kyushujin 2 wikitext text/x-wiki このWikiの管理人です。 ==リンク== Twitter:https://twitter.com/kyushujindesu Scratch:https://scratch.mit.edu/users/tetudouieee/ 56222075fc0753048a36419b11a70b4f33f0885a 11 10 2024-02-07T09:46:19Z Kyushujin 2 /* リンク */ wikitext text/x-wiki このWikiの管理人です。 ==リンク== Twitter:https://twitter.com/kyushujindesu Scratch:https://scratch.mit.edu/users/tetudouieee/ 99f8b152cc27a2f7fd63b466360f8f70ba42c32f 架空鉄道一覧 0 5 8 2024-02-07T07:26:56Z Kyushujin 2 ページの作成:「このページでは、架空鉄道の一覧を載せる。 ==あ行== ===あ=== ===い=== ===う=== ===え=== ===お=== ==か行== ===か=== ===き=== ===く=== ===け=== ===こ=== ==さ行== ===さ=== ===し=== ===す=== ===せ=== ===そ=== ==た行== ===た=== ===ち=== ===つ=== ===て=== ===と=== ==な行== ===な=== ===に=== ===ぬ=== ===ね=== ===の=== ==は行== ===は=== ===ひ=== ===ふ=== ===へ=== ===ほ=== ==ま行== ===ま=== ===み=== ===む=== ==…」 wikitext text/x-wiki このページでは、架空鉄道の一覧を載せる。 ==あ行== ===あ=== ===い=== ===う=== ===え=== ===お=== ==か行== ===か=== ===き=== ===く=== ===け=== ===こ=== ==さ行== ===さ=== ===し=== ===す=== ===せ=== ===そ=== ==た行== ===た=== ===ち=== ===つ=== ===て=== ===と=== ==な行== ===な=== ===に=== ===ぬ=== ===ね=== ===の=== ==は行== ===は=== ===ひ=== ===ふ=== ===へ=== ===ほ=== ==ま行== ===ま=== ===み=== ===む=== ===め=== ===も=== ==や行== ===や=== ===ゆ=== ===よ=== ==ら行== ===ら=== ===り=== ===る=== ===れ=== ===ろ=== ==わ行== ===わ=== ==アルファベット== ===S=== *[[SR]] 512612c6f50e47acec4b118e648512913d9cd283 22 8 2024-02-08T22:19:44Z 2405:6587:D1A0:DA00:FCF2:8DA8:EFE9:C2C 0 /* お */ wikitext text/x-wiki このページでは、架空鉄道の一覧を載せる。 ==あ行== ===あ=== ===い=== ===う=== ===え=== ===お=== ・尾羽急電鉄 ==か行== ===か=== ===き=== ===く=== ===け=== ===こ=== ==さ行== ===さ=== ===し=== ===す=== ===せ=== ===そ=== ==た行== ===た=== ===ち=== ===つ=== ===て=== ===と=== ==な行== ===な=== ===に=== ===ぬ=== ===ね=== ===の=== ==は行== ===は=== ===ひ=== ===ふ=== ===へ=== ===ほ=== ==ま行== ===ま=== ===み=== ===む=== ===め=== ===も=== ==や行== ===や=== ===ゆ=== ===よ=== ==ら行== ===ら=== ===り=== ===る=== ===れ=== ===ろ=== ==わ行== ===わ=== ==アルファベット== ===S=== *[[SR]] ad922b0394bbbb765dfed209cd53fe34aae7b869 23 22 2024-02-08T22:21:30Z 2405:6587:D1A0:DA00:FCF2:8DA8:EFE9:C2C 0 wikitext text/x-wiki このページでは、架空鉄道の一覧を載せる。 ==あ行== ===あ=== ===い=== ===う=== ===え=== ===お=== ・尾羽急電鉄 ==か行== ===か=== ===き=== ===く=== ===け=== ===こ=== ==さ行== ===さ=== ===し=== ===す=== ===せ=== ===そ=== ==た行== ===た=== ===ち=== ===つ=== ===て=== ===と=== ==な行== ===な=== ===に=== ===ぬ=== ===ね=== ===の=== ==は行== ===は=== ===ひ=== ===ふ=== ===へ=== ===ほ=== ==ま行== ===ま=== ===み=== ===む=== ===め=== ===も=== ==や行== ===や=== ===ゆ=== 夢空急行電鉄 ===よ=== ==ら行== ===ら=== ===り=== ===る=== ===れ=== ===ろ=== ==わ行== ===わ=== ==アルファベット== ===S=== *[[SR]] 0c6d85859b000f9073ed712b6b739d74855acd13 24 23 2024-02-09T03:46:53Z 42.150.239.162 0 wikitext text/x-wiki このページでは、架空鉄道の一覧を載せる。 ==あ行== ===あ=== ===い=== ===う=== ===え=== ===お=== ==か行== ===か=== ===き=== ===く=== ===け=== ===こ=== ==さ行== ===さ=== ===し=== ===す=== ===せ=== ===そ=== ==た行== ===た=== ===ち=== ===つ=== ===て=== ===と=== ==な行== ===な=== ===に=== ===ぬ=== ===ね=== ===の=== ==は行== ===は=== ===ひ=== ===ふ=== ===へ=== ===ほ=== ==ま行== ===ま=== ===み=== ===む=== ===め=== ===も=== ==や行== ===や=== ===ゆ=== 夢空急行電鉄 ===よ=== ==ら行== ===ら=== ===り=== ===る=== ===れ=== ===ろ=== ==わ行== ===わ=== ==アルファベット== ===S=== *[[SR]] 3e460e84d7a49f9b38b4380e1a9d4e5d807e6e44 25 24 2024-02-09T03:47:26Z 42.150.239.162 0 wikitext text/x-wiki このページでは、架空鉄道の一覧を載せる。 ==あ行== ===あ=== ===い=== ===う=== ===え=== ===お=== ==か行== ===か=== ===き=== ===く=== ===け=== ===こ=== ==さ行== ===さ=== ===し=== ===す=== ===せ=== ===そ=== ==た行== ===た=== ===ち=== ===つ=== ===て=== ===と=== ==な行== ===な=== ===に=== ===ぬ=== ===ね=== ===の=== ==は行== ===は=== ===ひ=== ===ふ=== ===へ=== ===ほ=== ==ま行== ===ま=== ===み=== ===む=== ===め=== ===も=== ==や行== ===や=== ===ゆ=== ===よ=== ==ら行== ===ら=== ===り=== ===る=== ===れ=== ===ろ=== ==わ行== ===わ=== ==アルファベット== ===S=== *[[SR]] 512612c6f50e47acec4b118e648512913d9cd283 26 25 2024-02-09T03:49:18Z 42.150.239.162 0 wikitext text/x-wiki このページでは、架空鉄道の一覧を載せる。 <!-- Scratch以外の架空鉄道(Robloxなど)については記載しないでください --> ==あ行== ===あ=== ===い=== ===う=== ===え=== ===お=== ==か行== ===か=== ===き=== ===く=== ===け=== ===こ=== ==さ行== ===さ=== ===し=== ===す=== ===せ=== ===そ=== ==た行== ===た=== ===ち=== ===つ=== ===て=== ===と=== ==な行== ===な=== ===に=== ===ぬ=== ===ね=== ===の=== ==は行== ===は=== ===ひ=== ===ふ=== ===へ=== ===ほ=== ==ま行== ===ま=== ===み=== ===む=== ===め=== ===も=== ==や行== ===や=== ===ゆ=== ===よ=== ==ら行== ===ら=== ===り=== ===る=== ===れ=== ===ろ=== ==わ行== ===わ=== ==アルファベット== ===S=== *[[SR]] 199284f8b3698d247f2999a9f07a6904eddc6c5e SR本線 0 7 27 2024-02-09T06:35:58Z Kyushujin 2 ページの作成:「'''SR本線'''(エスアールほんせん)は、[[Scratch中央駅]]から[[蒼原県]][[理間咲市]]の[[理間咲駅]]までを結ぶ[[SR]]の鉄道路線である。 ==運行形態== ==駅一覧== 普通、S急行は各駅に停車するため省略。 S急行はScratch中央~氷原間のみ運転。<br> 急行列車の停車駅は「[[おおや]]」「[[かいばる]]」を参照。 ナノ工場~理間咲間は[[蒼原県]]に所在。Scratch中央駅の…」 wikitext text/x-wiki '''SR本線'''(エスアールほんせん)は、[[Scratch中央駅]]から[[蒼原県]][[理間咲市]]の[[理間咲駅]]までを結ぶ[[SR]]の鉄道路線である。 ==運行形態== ==駅一覧== 普通、S急行は各駅に停車するため省略。 S急行はScratch中央~氷原間のみ運転。<br> 急行列車の停車駅は「[[おおや]]」「[[かいばる]]」を参照。 ナノ工場~理間咲間は[[蒼原県]]に所在。Scratch中央駅の所在地は不明。 {| class="wikitable" |- ! 駅名 !! 準<br>快<br>速 !! 通<br>勤<br>快<br>速 !! 快<br>速 !! 接続路線・備考 ! colspan="2"|所在地 |- | [[Scratch中央駅]] || ● || ● || ● || [[Scratch鉄道本線]] |- | [[ナノ工場駅]] || | || ● || | || | rowspan="28"|[[蒼原県|蒼<br>原<br>県]] || rowspan="7"|[[氷原市]] |- | [[ゴボ大学駅]] || ● || ● || ● || [[博物館線]] |- | [[スタジオ整理所駅]] || | || | || | |- | [[氷原駅]] || ● || ● || ● || [[地平線]] |- | [[西氷原駅]] || | || | || | || |- | [[スリンタウン駅]] || ● || ● || ● || |- | [[南葉駅]] || | || | || | || |- | [[熊壁駅]] || ● || ● || ● || | rowspan="3"|[[熊壁市]] |- | [[公原駅]] || | || ● || | || |- | [[大矢口駅]] || ● || ● || ● || [[上野線]] |- | [[江立駅]] || ● || | || | || | rowspan="6"|[[大矢町]] |- | [[大矢駅]] || ● || ● || ● || |- | [[中崎駅]] || ● || ● || | || |- | [[野岡駅]] || ● || ● || ● || |- | [[北野岡駅]] || ● || | || | || |- | [[和原駅]] || ● || ● || | || |- | [[南与川駅]] || ● || | || | || | rowspan="5"|[[与川町]] |- | [[与川駅]] || ● || ● || ● || |- | [[片砂駅]] || ● || | || | || |- | [[人空温泉駅]] || ● || ● || ● || |- | [[差家駅]] || ● || ● || ● || |- | [[東多穂駅]] || ● || ● || | || | rowspan="7"|[[理間咲市]] |- | [[多穂駅]] || ● || ● || ● || |- | [[大上駅]] || | || | || | || |- | [[豆田駅]] || ● || ● || ● || |- | [[花原駅]] || | || | || | || |- | [[山沢駅]] || | || | || | || |- | [[理間咲駅]] || ● || ● || ● || |} dc377613b3f1867a9f61c8d13d60561890a9d36e テンプレート:Infobox 10 8 29 28 2024-02-09T10:36:28Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly>{{#invoke:infobox/former|main}}</includeonly><noinclude>{{documentation}}</noinclude> 4a97880488542cb91a07c1e4815b083755983b8f テンプレート:Infobox/doc 10 9 31 30 2024-02-09T10:36:28Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <noinclude>{{Documentation subpage}}</noinclude> <includeonly>{{使用箇所の多いテンプレート|600,000以上}}{{Lua|モジュール:Infobox/former}}</includeonly> {{Main|Help:Infobox}} == 使い方 == このテンプレートはメタテンプレート(他のテンプレートを作成するときに使われるテンプレート)として使われることを想定しています。記事に直接使われることを想定していません。<!--ページが無いのでコメントアウト→一般的なInfoboxの作り方については[[Help:Infobox]]を見てください。--> 使い方は{{Tl|Navbox}}に似ていますが、追加された機能があります。テーブルの各行は「見出し」(header) でも、ラベルとデータ対でも、単なるデータセルでもありえます。また、ある行に見出しとラベル/データ対の両方を定義すれば、ラベル/データ対は無視されます。 Infoboxの最上部以外のどこかで画像を挿入したい場合、あるいは他の「自由な形式」のデータを挿入したい場合、<!-- そのような使用を許している -->“data”フィールドによる行を使うように注意してください。 === パラメータ === このテンプレートでは全てのパラメータを省略可能です。 ==== タイトル ==== タイトルをキャプションにする場合にはtitle、最上部のヘッダセルにする場合にはaboveを使います。通常はどちらか片方を使いますが、両方使うこともできます。 ; title : 表のキャプションに置くテキストです。 ; above : 表の最上部に置くテキストです。 ; subheader<var>n</var> : 表の最上部と画像の間に表示されるテキストです。<var>n</var>を指定しない場合は“<var>n</var>=1”と見なされます。 ==== テキストなど ==== ; name(または tnavbar) : 表の最下部の、テンプレート本体へのリンクを表示するために必要なテンプレート名です。<nowiki>{{subst:PAGENAME}}</nowiki>を使うことができますが、<nowiki><includeonly></includeonly></nowiki>をはさんでいる場合はsubst展開されないので注意してください。指定が無い場合はリンクが表示されません。 ; image<var>n</var> : テンプレートの上部に表示される画像です。<nowiki>[[ファイル:example.png|200px]]</nowiki>のような、完全な画像構文を使ってください。デフォルトで中央に表示されます。<var>n</var>を指定しない場合は“<var>n</var>=1”と見なされます。 ; caption<var>n</var> : 画像の下に置くテキストです。<var>n</var>を指定しない場合は“<var>n</var>=1”と見なされます。 ; header<var>n</var> : 列<var>n</var>のヘッダとして使うテキストです。 ; label<var>n</var>: 列<var>n</var>のラベルとして使うテキストです。 ; data<var>n</var>: 列<var>n</var>のデータとして表示されるテキストです。 ; below : 最下行に置くテキストです。脚注、関連項目、その他の情報として使われることを想定しています。 ==== CSSスタイル ==== ; bodystyle : Infobox全体のスタイル指定です。 ; titlestyle : タイトルセルだけのスタイル指定です。 ; abovestyle : 表の最上部のセルだけのスタイル指定です。 ; imagestyle : 画像があるセル(captionも含む)のスタイル指定です。 ; captionstyle : captionのテキストのスタイル指定です。 ; headerstyle : 全てのヘッダセルのスタイル指定です。 ; headerstyle<var>n</var>: header<var>n</var>セルのスタイル指定です。<br />中国語版などで使われているTemplate:Infoboxとはheader<var>n</var>style。翻訳時にテンプレートを変える場合は注意してください。 ; labelstyle : 全てのラベルセルのスタイル指定です。 ; labelstyle<var>n</var>: label<var>n</var>セルのスタイル指定です。<br />中国語版などで使われているTemplate:Infoboxとはlabel<var>n</var>style。翻訳時にテンプレートを変える場合は注意してください。 ; datastyle : 全てのデータセルのスタイル指定です。 ; datastyle<var>n</var>: data<var>n</var>セルのスタイル指定です。<br />中国語版などで使われているTemplate:Infoboxとはdata<var>n</var>style。翻訳時にテンプレートを変える場合は注意してください。 ; belowstyle : 最下行のセルだけのスタイル指定です。 ==== クラス ==== ; bodyclass : このパラメータは、Infobox全体の「class」属性に挿入されます。デフォルトは <code>infobox</code> です。そのため、このパラメータに <code>bordered</code> と記述すると <code>infobox bordered</code> となるので、表全体に罫線が引かれます。 ; titleclass : タイトルセルだけのクラス指定です。 ; subheaderrowclass : subheaderのある行のクラス指定です。 ; subheaderclass : subheaderのテキストのクラス指定です。 ; aboveclass : 表の最上部のセルだけのクラス指定です。 ; imagerowclass : 画像がある行(captionも含む)のクラス指定です。 ; imageclass : 画像があるセル(captionも含む)のクラス指定です。 ; rowclass<var>n</var> : header<var>n</var>またはdata<var>n</var>のある行のクラス指定です。 ; class<var>n</var> : data<var>n</var>セルのクラス指定です。 ; belowclass : 表の最下行のセルだけのクラス指定です。 ==== マイクロデータ ==== ; bodyitemtype : 表全体のタイプ (URI) 指定です。 ; bodyitemref : 表全体の参照するスコープ部分以外のID指定です。 ; rowitemprop<var>n</var> : header<var>n</var>またはdata<var>n</var>のある行全体のプロパティ指定です。 ; rowitemtype<var>n</var> : header<var>n</var>またはdata<var>n</var>のある行全体のタイプ (URI) 指定です。 ; rowitemref<var>n</var> : header<var>n</var>またはdata<var>n</var>のある行全体の参照するスコープ部分以外のID指定です。 ; itemprop<var>n</var> : data<var>n</var>セルのプロパティ指定です。 ; itemtype<var>n</var> : data<var>n</var>セルのタイプ (URI) 指定です。 ; itemref<var>n</var> : data<var>n</var>セルの参照するスコープ部分以外のID指定です。 ; id<var>n</var> : data<var>n</var>セルのID指定です。 ==== 組み込み ==== Infoboxテンプレートの<code>data<var>n</var></code>に{{para|child}}のパラメータを設定したInfoboxテンプレートの構文を記述することでInfobox内に別のInfoboxを組み込むことが出来ます。項目数を拡張した基礎情報テンプレートを作成できるなどの利点があります。{{para|child}}を設定しないと二重に罫線が書かれるため見た目がよくありません。 {{Infobox | data1 = {{Infobox | child = yes | title = 第1サブセクション | label1 = ラベル1.1 | data1 = データ1.1 }} | data2 = {{Infobox | child = yes | title = 第2サブセクション | label1 = ラベル2.1 | data1 = データ2.1 }} | belowstyle = | below = 最下部テキスト }} <pre style="overflow:auto">{{Infobox | data1 = {{Infobox | child = yes | title = 第1サブセクション | label1 = ラベル1.1 | data1 = データ1.1 }} | data2 = {{Infobox | child = yes | title = 第2サブセクション | label1 = ラベル2.1 | data1 = データ2.1 }} | belowstyle = | below = 最下部テキスト }}</pre> == 表示例 == {{Multicol|45em}} === 通常 === {{Infobox | title = title | above = above | abovestyle = background-color:#ccf | headerstyle = background-color:#ccf | subheader = subheader | subheader2 = subheader2 | image = [[ファイル:Example.svg|200px]] | caption = caption | image2 = [[ファイル:Example.svg|200px]] | caption2 = caption2 | header1 = header1 | label2 = label2 | data2 = data2 | belowstyle = background-color:#ccf | below = below }} {{Multicol-break}} === bodyclassにborderedを指定 === {{Infobox | bodyclass = bordered | title = title | above = above | abovestyle = background-color:#ccf | headerstyle = background-color:#ccf | subheader = subheader | subheader2 = subheader2 | image = [[ファイル:Example.svg|200px]] | caption = caption | image2 = [[ファイル:Example.svg|200px]] | caption2 = caption2 | header1 = header1 | label2 = label2 | data2 = data2 | belowstyle = background-color:#ccf | below = below }} {{multicol-end}} {{Clear}} == フォーマット == <pre style="overflow:auto">{{Infobox | bodyclass = | bodystyle = | bodyitemtype = | bodyitemref = | titleclass = | titlestyle = | title = | aboveclass = | abovestyle = | above = | subheaderstyle = | subheader = | subheader2 = . . . | imagestyle = | captionstyle = | image = | caption = | image2 = | caption2 = . . . | header1 = | label1 = | labelstyle1 = | data1 = | datastyle1 = | class1 = | id1 = | rowitemprop1 = | rowitemtype1 = | rowitemref1 = | itemprop1 = | itemtype1 = | itemref1 = | header2 = | label2 = | labelstyle2 = | data2 = | datastyle2 = | class2 = | id2 = | rowitemtype2 = | rowitemref2 = | itemprop2 = | itemtype2 = | itemref2 = . . . | belowclass = | belowstyle = | below = }} </pre> === 関連テンプレート === * {{tl|infobox3cols}} <includeonly>{{Sandbox other|| <!--カテゴリは以下に追加してください--> {{デフォルトソート:{{PAGENAME}}}} [[Category:基礎情報テンプレート| ]] [[Category:メタテンプレート]] }}</includeonly> 3fe4a4aceddf2cd1004a93eaaf4f8db67fd2c6e0 モジュール:Infobox/former 828 10 33 32 2024-02-09T10:36:28Z Kyushujin 2 1版 をインポートしました Scribunto text/plain local p = {} function p.main(frame) local args = require('Module:Arguments').getArgs(frame, {parentOnly = true}) --引数取得 local child = (args.child == 'yes') local subbox = (args.subbox == 'yes') local h = {subheader = {}, image = {{}}} --ヘッダー部(subheader, image)テーブル local body, sbody = {}, {} --本体部テーブル, ソート済み本体部テーブル local link = args.tnavbar or args.name --(フッター部)テンプレート名 local result = '' --結果格納用 --[[ subheader, image用引数振り分け ]] local function args2tbl(str, k, v) local num = string.match(k, '%d*$') num = (num == '') and 1 or tonumber(num) h[str][num] = h[str][num] or {} if k == str then h[str][1][1] = v elseif string.match(k, str .. '%d+') then h[str][num][1] = v elseif string.find(k, 'style') then if string.match(k, 'style$') then h[str]['style'] = v else h[str][num]['style'] = v end elseif string.find(k, 'rowclass') then if string.match(k, 'rowclass$') then h[str]['rowclass'] = v else h[str][num]['rowclass'] = v end elseif string.match(k, 'class$') then h[str]['class'] = v end end --[[ 引数振り分け ]] for k, v in pairs(args) do --subheader if string.find(k, 'subheader') then args2tbl('subheader', k, v) --image elseif string.find(k, 'image') then args2tbl('image', k, v) elseif string.find(k, 'caption') then if string.match(k, 'caption$') then h['image'][1]['caption'] = '<div style="' .. (args.captionstyle or '') .. '">' .. v .. '</div>' elseif string.match(k, 'caption%d+') then local num = tonumber(string.match(k, '%d*$')) h['image'][num] = h['image'][num] or {} h['image'][num]['caption'] = '<div style="' .. (args.captionstyle or '') .. '">' .. v .. '</div>' end --その他(本体部) elseif string.match(k, '^%D+%d+$') then local str, num = string.match(k, '^(%D+)(%d+)$') num = tonumber(num) if not body[num] then local OddOrEven = (num % 2 ~= 0) and 'odd' or 'even' body[num] = { num, headerstyle = (args.headerstyle or '') .. (args[OddOrEven .. 'headerstyle'] or ''), labelstyle = (args.labelstyle or '') .. (args[OddOrEven .. 'labelstyle'] or ''), datastyle = (args.datastyle or '') .. (args[OddOrEven .. 'datastyle'] or '') } end body[num][str] = (body[num][str] or '') .. v end end --[[ Template:Infobox/row ]] local function row(header, headerstyle, label, labelstyle, data, datastyle, rowstyle, class, rowclass, id, itemprop, rowitemprop, itemtype, rowitemtype, itemref, rowitemref) local result ='' if header then result = '<tr style="' .. (rowstyle or '') ..'"' .. (rowitemtype and (' itemscope itemtype="' .. rowitemtype .. '"') or '') .. ' itemref="' .. (rowitemref or '') .. '"><th scope="col" colspan="2" class="' .. (class or '') .. '" style="text-align:center; ' .. (headerstyle or '') .. '">' .. header .. '</th></tr>' elseif data then result = '<tr class="' .. (rowclass or '') .. '" style="' .. (rowstyle or '') .. '" itemprop="' .. (rowitemprop or '') .. '"' .. (rowitemtype and (' itemscope itemtype="' .. rowitemtype .. '"') or '') .. ' itemref="' .. (rowitemref or '') .. '">' if label then result = result .. '<th scope="row" style="text-align:left; white-space:nowrap; ' .. (labelstyle or '') .. '">' .. label .. '</th><td class="' .. (class or '') .. '" style="' .. (datastyle or '') .. '" itemprop="' .. (itemprop or '') .. '"' .. (itemtype and (' itemscope itemtype="' .. itemtype .. '"') or '') .. ' itemref="' .. (itemref or '') .. '">' else result = result .. '<td colspan="2" class="' .. (class or '') .. '" style="text-align:center; ' .. (datastyle or '') .. '" itemprop="' .. (itemprop or '') .. '"' .. (itemtype and (' itemscope itemtype="' .. rowitemtype .. '"') or '') .. ' itemref="' .. (itemref or '') .. '">' end result = result .. '\n' .. data .. '</td></tr>' end return result end --[[ Template:Infobox ]] --ヘッダー部 if not child then --tableタグ result = '<table class="' .. (subbox and '' or 'infobox ') .. (args.bodyclass or '') .. '" style="' .. (subbox and 'min-width:100%; width:calc(100% + 6px); margin:-3px; ' or 'width:22em; ') .. (args.bodystyle or '') .. '"' .. (args.bodyitemtype and (' itemscope itemtype="' .. args.bodyitemtype .. '"') or '') .. ' itemref="' .. (args.bodyitemref or '') .. '">' if args.title then --captionタグ result = result .. '<caption itemprop="name" class="' .. (args.titleclass or '') .. '" style="' .. (args.titlestyle or '') .. '">' .. args.title .. '</caption>' end if args.above then result = result .. '<tr><th colspan="2" class="' .. (args.aboveclass or '') .. '" style="text-align:center; font-size:125%; font-weight:bold; ' .. (args.abovestyle or '') .. '" itemprop="' .. (args.aboveitemprop or '') .. '"' .. (args.aboveitemtype and (' itemscope itemtype="' .. args.aboveitemtype .. '"') or '') .. ' itemref="' .. (args.aboveitemref or '') .. '">' .. args.above ..'</th></tr>' end else if args.title then result = '<b itemprop="name' .. '"' .. (args.bodyitemtype and (' itemscope itemtype="' .. args.bodyitemtype .. '"') or '') .. ' itemref="' .. (args.bodyitemref or '') .. '">' .. args.title .. '</b>' end end for k, v in pairs(h.subheader) do result = result .. row(nil, nil, nil, nil, v[1], v.style or h.subheader.style, v.rowstyle, h.subheader.class, v.rowclass, nil, nil, nil, nil, nil, nil, nil) end for k, v in pairs(h.image) do result = result .. row(nil, nil, nil, nil, v[1] and (v[1] .. (v.caption or '')), v.style or h.image.style, v.rowstyle, h.image.class, v.rowclass, nil, nil, nil, nil, nil, nil, nil) end --本体部ソート for k, v in pairs(body) do sbody[#sbody + 1] = v end table.sort(sbody, function (a, b) return a[1] < b[1] end ) --本体部 for k, v in ipairs(sbody) do result = result .. row(v.header, v.headerstyle, v.label, v.labelstyle, v.data, v.datastyle, v.rowstyle, v.class, v.rowclass, v.id, v.itemprop, v.rowitemprop, v.itemtype, v.rowitemtype, v.itemref, v.rowitemref) end --フッター部 if args.below then result = result .. '<tr><td colspan="2" class="' .. (args.belowclass or '') .. '" style="text-align:center; ' .. (args.belowstyle or '') .. '">' .. args.below .. '</td></tr>' end if link then --Template:Transclude link = string.gsub(link, ':?[Tt]emplate:', '') if not string.find(link, ':') then link = 'Template:' .. link end result = result .. '<tr class="noprint"><td colspan=2 style="text-align:right; font-size:85%;">[[' .. link .. '|テンプレートを表示]]</td></tr>' end --tableタグ閉じ if not child then result = result .. '</table>' end --出力 return result end return p e9e52feaf43d7ce5ca20209c5a536f7309cdfdaf モジュール:Arguments 828 11 35 34 2024-02-09T10:36:29Z Kyushujin 2 1版 をインポートしました Scribunto text/plain -- This module provides easy processing of arguments passed to Scribunto from -- #invoke. It is intended for use by other Lua modules, and should not be -- called from #invoke directly. local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local arguments = {} -- Generate four different tidyVal functions, so that we don't have to check the -- options every time we call it. local function tidyValDefault(key, val) if type(val) == 'string' then val = val:match('^%s*(.-)%s*$') if val == '' then return nil else return val end else return val end end local function tidyValTrimOnly(key, val) if type(val) == 'string' then return val:match('^%s*(.-)%s*$') else return val end end local function tidyValRemoveBlanksOnly(key, val) if type(val) == 'string' then if val:find('%S') then return val else return nil end else return val end end local function tidyValNoChange(key, val) return val end local function matchesTitle(given, title) local tp = type( given ) return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title end local translate_mt = { __index = function(t, k) return k end } function arguments.getArgs(frame, options) checkType('getArgs', 1, frame, 'table', true) checkType('getArgs', 2, options, 'table', true) frame = frame or {} options = options or {} --[[ -- Set up argument translation. --]] options.translate = options.translate or {} if getmetatable(options.translate) == nil then setmetatable(options.translate, translate_mt) end if options.backtranslate == nil then options.backtranslate = {} for k,v in pairs(options.translate) do options.backtranslate[v] = k end end if options.backtranslate and getmetatable(options.backtranslate) == nil then setmetatable(options.backtranslate, { __index = function(t, k) if options.translate[k] ~= k then return nil else return k end end }) end --[[ -- Get the argument tables. If we were passed a valid frame object, get the -- frame arguments (fargs) and the parent frame arguments (pargs), depending -- on the options set and on the parent frame's availability. If we weren't -- passed a valid frame object, we are being called from another Lua module -- or from the debug console, so assume that we were passed a table of args -- directly, and assign it to a new variable (luaArgs). --]] local fargs, pargs, luaArgs if type(frame.args) == 'table' and type(frame.getParent) == 'function' then if options.wrappers then --[[ -- The wrappers option makes Module:Arguments look up arguments in -- either the frame argument table or the parent argument table, but -- not both. This means that users can use either the #invoke syntax -- or a wrapper template without the loss of performance associated -- with looking arguments up in both the frame and the parent frame. -- Module:Arguments will look up arguments in the parent frame -- if it finds the parent frame's title in options.wrapper; -- otherwise it will look up arguments in the frame object passed -- to getArgs. --]] local parent = frame:getParent() if not parent then fargs = frame.args else local title = parent:getTitle():gsub('/sandbox$', '') local found = false if matchesTitle(options.wrappers, title) then found = true elseif type(options.wrappers) == 'table' then for _,v in pairs(options.wrappers) do if matchesTitle(v, title) then found = true break end end end -- We test for false specifically here so that nil (the default) acts like true. if found or options.frameOnly == false then pargs = parent.args end if not found or options.parentOnly == false then fargs = frame.args end end else -- options.wrapper isn't set, so check the other options. if not options.parentOnly then fargs = frame.args end if not options.frameOnly then local parent = frame:getParent() pargs = parent and parent.args or nil end end if options.parentFirst then fargs, pargs = pargs, fargs end else luaArgs = frame end -- Set the order of precedence of the argument tables. If the variables are -- nil, nothing will be added to the table, which is how we avoid clashes -- between the frame/parent args and the Lua args. local argTables = {fargs} argTables[#argTables + 1] = pargs argTables[#argTables + 1] = luaArgs --[[ -- Generate the tidyVal function. If it has been specified by the user, we -- use that; if not, we choose one of four functions depending on the -- options chosen. This is so that we don't have to call the options table -- every time the function is called. --]] local tidyVal = options.valueFunc if tidyVal then if type(tidyVal) ~= 'function' then error( "bad value assigned to option 'valueFunc'" .. '(function expected, got ' .. type(tidyVal) .. ')', 2 ) end elseif options.trim ~= false then if options.removeBlanks ~= false then tidyVal = tidyValDefault else tidyVal = tidyValTrimOnly end else if options.removeBlanks ~= false then tidyVal = tidyValRemoveBlanksOnly else tidyVal = tidyValNoChange end end --[[ -- Set up the args, metaArgs and nilArgs tables. args will be the one -- accessed from functions, and metaArgs will hold the actual arguments. Nil -- arguments are memoized in nilArgs, and the metatable connects all of them -- together. --]] local args, metaArgs, nilArgs, metatable = {}, {}, {}, {} setmetatable(args, metatable) local function mergeArgs(tables) --[[ -- Accepts multiple tables as input and merges their keys and values -- into one table. If a value is already present it is not overwritten; -- tables listed earlier have precedence. We are also memoizing nil -- values, which can be overwritten if they are 's' (soft). --]] for _, t in ipairs(tables) do for key, val in pairs(t) do if metaArgs[key] == nil and nilArgs[key] ~= 'h' then local tidiedVal = tidyVal(key, val) if tidiedVal == nil then nilArgs[key] = 's' else metaArgs[key] = tidiedVal end end end end end --[[ -- Define metatable behaviour. Arguments are memoized in the metaArgs table, -- and are only fetched from the argument tables once. Fetching arguments -- from the argument tables is the most resource-intensive step in this -- module, so we try and avoid it where possible. For this reason, nil -- arguments are also memoized, in the nilArgs table. Also, we keep a record -- in the metatable of when pairs and ipairs have been called, so we do not -- run pairs and ipairs on the argument tables more than once. We also do -- not run ipairs on fargs and pargs if pairs has already been run, as all -- the arguments will already have been copied over. --]] metatable.__index = function (t, key) --[[ -- Fetches an argument when the args table is indexed. First we check -- to see if the value is memoized, and if not we try and fetch it from -- the argument tables. When we check memoization, we need to check -- metaArgs before nilArgs, as both can be non-nil at the same time. -- If the argument is not present in metaArgs, we also check whether -- pairs has been run yet. If pairs has already been run, we return nil. -- This is because all the arguments will have already been copied into -- metaArgs by the mergeArgs function, meaning that any other arguments -- must be nil. --]] if type(key) == 'string' then key = options.translate[key] end local val = metaArgs[key] if val ~= nil then return val elseif metatable.donePairs or nilArgs[key] then return nil end for _, argTable in ipairs(argTables) do local argTableVal = tidyVal(key, argTable[key]) if argTableVal ~= nil then metaArgs[key] = argTableVal return argTableVal end end nilArgs[key] = 'h' return nil end metatable.__newindex = function (t, key, val) -- This function is called when a module tries to add a new value to the -- args table, or tries to change an existing value. if type(key) == 'string' then key = options.translate[key] end if options.readOnly then error( 'could not write to argument table key "' .. tostring(key) .. '"; the table is read-only', 2 ) elseif options.noOverwrite and args[key] ~= nil then error( 'could not write to argument table key "' .. tostring(key) .. '"; overwriting existing arguments is not permitted', 2 ) elseif val == nil then --[[ -- If the argument is to be overwritten with nil, we need to erase -- the value in metaArgs, so that __index, __pairs and __ipairs do -- not use a previous existing value, if present; and we also need -- to memoize the nil in nilArgs, so that the value isn't looked -- up in the argument tables if it is accessed again. --]] metaArgs[key] = nil nilArgs[key] = 'h' else metaArgs[key] = val end end local function translatenext(invariant) local k, v = next(invariant.t, invariant.k) invariant.k = k if k == nil then return nil elseif type(k) ~= 'string' or not options.backtranslate then return k, v else local backtranslate = options.backtranslate[k] if backtranslate == nil then -- Skip this one. This is a tail call, so this won't cause stack overflow return translatenext(invariant) else return backtranslate, v end end end metatable.__pairs = function () -- Called when pairs is run on the args table. if not metatable.donePairs then mergeArgs(argTables) metatable.donePairs = true end return translatenext, { t = metaArgs } end local function inext(t, i) -- This uses our __index metamethod local v = t[i + 1] if v ~= nil then return i + 1, v end end metatable.__ipairs = function (t) -- Called when ipairs is run on the args table. return inext, t, 0 end return args end return arguments 3134ecce8429b810d445e29eae115e2ae4c36c53 テンプレート:Infobox 鉄道路線 10 12 37 36 2024-02-09T10:36:29Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{Infobox |name = Infobox 鉄道路線 |bodyclass = |bodystyle = width:300px; |abovestyle = {{#if:{{{路線色|}}}|border-top: 4px solid {{{路線色}}}; border-bottom: 4px solid {{#if:{{{路線色2|}}}|{{{路線色2}}}|{{{路線色}}}}};}} |above = {{{路線名|{{PAGENAME}}}}} |subheader = {{#invoke:InfoboxImage|InfoboxImage|image={{{ロゴ|}}}|size={{{ロゴサイズ|90px}}}|sizedefault=90px|alt=シンボルマーク}} |image = {{#invoke:InfoboxImage|InfoboxImage|image={{{画像|}}}|size={{{画像サイズ|300px}}}|sizedefault=300px|alt={{{画像説明|}}}}} |caption = {{{画像説明<includeonly>|</includeonly>}}} |headerstyle= background: #efefef; |header1 = 基本情報 |label2 = 通称 |data2 = {{{通称<includeonly>|</includeonly>}}} |label3 = 現況 |data3 = {{{現況<includeonly>|</includeonly>}}} |label4 = 国 |data4 = {{{国<includeonly>|</includeonly>}}} |label5 = 所在地 |data5 = {{{所在地<includeonly>|</includeonly>}}} |label7 = 種類 |data7 = {{{種類<includeonly>|</includeonly>}}} |label8 = 路線網 |data8 = {{{路線網<includeonly>|</includeonly>}}} |label9 = 区間 |data9 = {{{区間<includeonly>|</includeonly>}}} |label10 = 起点 |data10 = {{{起点<includeonly>|</includeonly>}}} |label11 = 終点 |data11 = {{{終点<includeonly>|</includeonly>}}} |label12 = 駅数 |data12 = {{{駅数<includeonly>|</includeonly>}}} |label13 = 停留場数 |data13 = {{{停留場数<includeonly>|</includeonly>}}} |label14 = 停留所数 |data14 = {{{停留所数<includeonly>|</includeonly>}}} |label15 = 経由路線 |data15 = {{{経由路線<includeonly>|</includeonly>{{{構成路線|}}}}}} |label16 = 輸送実績 |data16 = {{{輸送実績<includeonly>|</includeonly>}}} |label17 = 1日利用者数 |data17 = {{{1日利用者数<includeonly>|</includeonly>}}} |label18 = [[電報略号 (鉄道)|電報略号]] |data18 = {{{電報略号<includeonly>|</includeonly>}}} |label19 = 路線記号 |data19 = {{{路線記号<includeonly>|</includeonly>}}} |label20 = 路線番号 |data20 = {{{路線番号<includeonly>|</includeonly>}}} |label21 = [[日本の鉄道ラインカラー一覧|路線色]] |data21 = {{{路線色3<includeonly>|</includeonly>}}} |header30 = <!--運営--> |label31 = 開業 |data31 = {{{開業<includeonly>|</includeonly>}}} |label32 = {{{項目1|}}} |data32 = {{{日付1|}}} |label33 = {{{項目2|}}} |data33 = {{{日付2|}}} |label34 = {{{項目3|}}} |data34 = {{{日付3|}}} |label35 = 最終延伸 |data35 = {{{最終延伸<includeonly>|</includeonly>}}} |label36 = 全通 |data36 = {{{全通<includeonly>|</includeonly>}}} |label37 = 休止 |data37 = {{{休止<includeonly>|</includeonly>}}} |label38 = 廃止 |data38 = {{{廃止<includeonly>|</includeonly>}}} |label39 = 再開 |data39 = {{{再開<includeonly>|</includeonly>}}} |label40 = 所有者 |data40 = {{{所有者<includeonly>|</includeonly>}}} |label41 = 運営者 |data41 = {{{運営者<includeonly>|</includeonly>{{{運行者|}}}}}} |label42 = 路線構造 |data42 = {{{路線構造<includeonly>|</includeonly>}}} |label43 = [[運転指令所]] |data43 = {{{運転指令所<includeonly>|</includeonly>}}} |label44 = [[車両基地]] |data44 = {{{車両基地<includeonly>|</includeonly>}}} |label45 = 使用車両 |data45 = {{{使用車両<includeonly>|</includeonly>}}} |header50 = 路線諸元 |label51 = 路線距離 |data51 = {{{路線距離<includeonly>|</includeonly>{{{総延長|}}}}}} |label53 = [[営業キロ]] |data53 = {{{営業キロ<includeonly>|</includeonly>}}} |label54 = [[軌間]] |data54 = {{{軌間<includeonly>|</includeonly>}}} |label57 = 線路数 |data57 = {{{線路数<includeonly>|</includeonly>}}} |label58 = [[複線|複線区間]] |data58 = {{{複線区間|}}} |label59 = 電化区間 |data59 = {{{電化区間|}}} |label60 = [[鉄道の電化|電化方式]] |data60 = {{{電化方式<includeonly>|</includeonly>}}} |label61 = [[車両限界]] |data61 = {{{車両限界<includeonly>|</includeonly>}}} |label62 = [[線形 (路線)#勾配|最大勾配]] |data62 = {{{最大勾配<includeonly>|</includeonly>}}} |label63 = [[線形 (路線)#平面線形|最小曲線半径]] |data63 = {{{最小曲線半径<includeonly>|</includeonly>}}} |label64 = 高低差 |data64 = {{{高低差<includeonly>|</includeonly>}}} |label65 = [[閉塞 (鉄道)|閉塞方式]] |data65 = {{{閉塞方式<includeonly>|</includeonly>}}} |label66 = [[自動列車保安装置|保安装置]] |data66 = {{{保安装置<includeonly>|</includeonly>}}} |label67 = [[ラック式鉄道|ラック方式]] |data67 = {{{ラック方式<includeonly>|</includeonly>}}} |label68 = [[鉄道の最高速度|最高速度]] |data68 = {{{最高速度<includeonly>|</includeonly>}}} |label69 = 駅間平均長 |data69 = {{{駅間平均長<includeonly>|</includeonly>}}} |label70 = {{{諸元備考<includeonly>|</includeonly>}}} |data70 = {{{諸元備考内容<includeonly>|</includeonly>}}} |belowstyle = vertical-align: middle; padding:0px; |below = {{#if:{{{路線図<includeonly>|</includeonly>}}}| <table style="width:100%; margin:0; border:none;" class="mw-collapsible {{#switch:{{{路線図表示|}}}|0 |no |#default = no |1 |yes |collapsed = mw-collapsed autocollapse }}"> <tr style="background-color: #efefef"><th>{{#if:{{{路線図名|}}}|{{{路線図名}}}|路線図}}</th></tr> <tr><td style="text-align:center"> {{#invoke:InfoboxImage|InfoboxImage|image={{{路線図<noinclude>|File:Placeholder.svg</noinclude>}}}|size=|sizedefault=300px}}</td></tr> </table>}} }}<noinclude>{{Documentation}}</noinclude> 3186fa29d3e1322d9e31d22493072ed545f8ea8e モジュール:TableTools 828 13 39 38 2024-02-09T10:36:30Z Kyushujin 2 1版 をインポートしました Scribunto text/plain --[[ ------------------------------------------------------------------------------------ -- TableTools -- -- -- -- This module includes a number of functions for dealing with Lua tables. -- -- It is a meta-module, meant to be called from other Lua modules, and should -- -- not be called directly from #invoke. -- ------------------------------------------------------------------------------------ --]] local libraryUtil = require('libraryUtil') local p = {} -- Define often-used variables and functions. local floor = math.floor local infinity = math.huge local checkType = libraryUtil.checkType local checkTypeMulti = libraryUtil.checkTypeMulti --[[ ------------------------------------------------------------------------------------ -- isPositiveInteger -- -- This function returns true if the given value is a positive integer, and false -- if not. Although it doesn't operate on tables, it is included here as it is -- useful for determining whether a given table key is in the array part or the -- hash part of a table. ------------------------------------------------------------------------------------ --]] function p.isPositiveInteger(v) return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity end --[[ ------------------------------------------------------------------------------------ -- isNan -- -- This function returns true if the given number is a NaN value, and false -- if not. Although it doesn't operate on tables, it is included here as it is -- useful for determining whether a value can be a valid table key. Lua will -- generate an error if a NaN is used as a table key. ------------------------------------------------------------------------------------ --]] function p.isNan(v) return type(v) == 'number' and tostring(v) == '-nan' end --[[ ------------------------------------------------------------------------------------ -- shallowClone -- -- This returns a clone of a table. The value returned is a new table, but all -- subtables and functions are shared. Metamethods are respected, but the returned -- table will have no metatable of its own. ------------------------------------------------------------------------------------ --]] function p.shallowClone(t) local ret = {} for k, v in pairs(t) do ret[k] = v end return ret end --[[ ------------------------------------------------------------------------------------ -- removeDuplicates -- -- This removes duplicate values from an array. Non-positive-integer keys are -- ignored. The earliest value is kept, and all subsequent duplicate values are -- removed, but otherwise the array order is unchanged. ------------------------------------------------------------------------------------ --]] function p.removeDuplicates(t) checkType('removeDuplicates', 1, t, 'table') local isNan = p.isNan local ret, exists = {}, {} for i, v in ipairs(t) do if isNan(v) then -- NaNs can't be table keys, and they are also unique, so we don't need to check existence. ret[#ret + 1] = v else if not exists[v] then ret[#ret + 1] = v exists[v] = true end end end return ret end --[[ ------------------------------------------------------------------------------------ -- numKeys -- -- This takes a table and returns an array containing the numbers of any numerical -- keys that have non-nil values, sorted in numerical order. ------------------------------------------------------------------------------------ --]] function p.numKeys(t) checkType('numKeys', 1, t, 'table') local isPositiveInteger = p.isPositiveInteger local nums = {} for k, v in pairs(t) do if isPositiveInteger(k) then nums[#nums + 1] = k end end table.sort(nums) return nums end --[[ ------------------------------------------------------------------------------------ -- affixNums -- -- This takes a table and returns an array containing the numbers of keys with the -- specified prefix and suffix. For example, for the table -- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will -- return {1, 3, 6}. ------------------------------------------------------------------------------------ --]] function p.affixNums(t, prefix, suffix) checkType('affixNums', 1, t, 'table') checkType('affixNums', 2, prefix, 'string', true) checkType('affixNums', 3, suffix, 'string', true) local function cleanPattern(s) -- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally. return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1') end prefix = prefix or '' suffix = suffix or '' prefix = cleanPattern(prefix) suffix = cleanPattern(suffix) local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$' local nums = {} for k, v in pairs(t) do if type(k) == 'string' then local num = mw.ustring.match(k, pattern) if num then nums[#nums + 1] = tonumber(num) end end end table.sort(nums) return nums end --[[ ------------------------------------------------------------------------------------ -- numData -- -- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table -- of subtables in the format -- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} } -- Keys that don't end with an integer are stored in a subtable named "other". -- The compress option compresses the table so that it can be iterated over with -- ipairs. ------------------------------------------------------------------------------------ --]] function p.numData(t, compress) checkType('numData', 1, t, 'table') checkType('numData', 2, compress, 'boolean', true) local ret = {} for k, v in pairs(t) do local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$') if num then num = tonumber(num) local subtable = ret[num] or {} if prefix == '' then -- Positional parameters match the blank string; put them at the start of the subtable instead. prefix = 1 end subtable[prefix] = v ret[num] = subtable else local subtable = ret.other or {} subtable[k] = v ret.other = subtable end end if compress then local other = ret.other ret = p.compressSparseArray(ret) ret.other = other end return ret end --[[ ------------------------------------------------------------------------------------ -- compressSparseArray -- -- This takes an array with one or more nil values, and removes the nil values -- while preserving the order, so that the array can be safely traversed with -- ipairs. ------------------------------------------------------------------------------------ --]] function p.compressSparseArray(t) checkType('compressSparseArray', 1, t, 'table') local ret = {} local nums = p.numKeys(t) for _, num in ipairs(nums) do ret[#ret + 1] = t[num] end return ret end --[[ ------------------------------------------------------------------------------------ -- sparseIpairs -- -- This is an iterator for sparse arrays. It can be used like ipairs, but can -- handle nil values. ------------------------------------------------------------------------------------ --]] function p.sparseIpairs(t) checkType('sparseIpairs', 1, t, 'table') local nums = p.numKeys(t) local i = 0 local lim = #nums return function () i = i + 1 if i <= lim then local key = nums[i] return key, t[key] else return nil, nil end end end --[[ ------------------------------------------------------------------------------------ -- size -- -- This returns the size of a key/value pair table. It will also work on arrays, -- but for arrays it is more efficient to use the # operator. ------------------------------------------------------------------------------------ --]] function p.size(t) checkType('size', 1, t, 'table') local i = 0 for k in pairs(t) do i = i + 1 end return i end local function defaultKeySort(item1, item2) -- "number" < "string", so numbers will be sorted before strings. local type1, type2 = type(item1), type(item2) if type1 ~= type2 then return type1 < type2 else -- This will fail with table, boolean, function. return item1 < item2 end end --[[ Returns a list of the keys in a table, sorted using either a default comparison function or a custom keySort function. ]] function p.keysToList(t, keySort, checked) if not checked then checkType('keysToList', 1, t, 'table') checkTypeMulti('keysToList', 2, keySort, { 'function', 'boolean', 'nil' }) end local list = {} local index = 1 for key, value in pairs(t) do list[index] = key index = index + 1 end if keySort ~= false then keySort = type(keySort) == 'function' and keySort or defaultKeySort table.sort(list, keySort) end return list end --[[ Iterates through a table, with the keys sorted using the keysToList function. If there are only numerical keys, sparseIpairs is probably more efficient. ]] function p.sortedPairs(t, keySort) checkType('sortedPairs', 1, t, 'table') checkType('sortedPairs', 2, keySort, 'function', true) local list = p.keysToList(t, keySort, true) local i = 0 return function() i = i + 1 local key = list[i] if key ~= nil then return key, t[key] else return nil, nil end end end --[[ Returns true if all keys in the table are consecutive integers starting at 1. --]] function p.isArray(t) checkType("isArray", 1, t, "table") local i = 0 for k, v in pairs(t) do i = i + 1 if t[i] == nil then return false end end return true end -- { "a", "b", "c" } -> { a = 1, b = 2, c = 3 } function p.invert(array) checkType("invert", 1, array, "table") local map = {} for i, v in ipairs(array) do map[v] = i end return map end --[[ { "a", "b", "c" } -> { ["a"] = true, ["b"] = true, ["c"] = true } --]] function p.listToSet(t) checkType("listToSet", 1, t, "table") local set = {} for _, item in ipairs(t) do set[item] = true end return set end --[[ Recursive deep copy function. Preserves identities of subtables. ]] local function _deepCopy(orig, includeMetatable, already_seen) -- Stores copies of tables indexed by the original table. already_seen = already_seen or {} local copy = already_seen[orig] if copy ~= nil then return copy end if type(orig) == 'table' then copy = {} for orig_key, orig_value in pairs(orig) do copy[deepcopy(orig_key, includeMetatable, already_seen)] = deepcopy(orig_value, includeMetatable, already_seen) end already_seen[orig] = copy if includeMetatable then local mt = getmetatable(orig) if mt ~= nil then local mt_copy = deepcopy(mt, includeMetatable, already_seen) setmetatable(copy, mt_copy) already_seen[mt] = mt_copy end end else -- number, string, boolean, etc copy = orig end return copy end function p.deepCopy(orig, noMetatable, already_seen) checkType("deepCopy", 3, already_seen, "table", true) return _deepCopy(orig, not noMetatable, already_seen) end --[[ Concatenates all values in the table that are indexed by a number, in order. sparseConcat{ a, nil, c, d } => "acd" sparseConcat{ nil, b, c, d } => "bcd" ]] function p.sparseConcat(t, sep, i, j) local list = {} local list_i = 0 for _, v in p.sparseIpairs(t) do list_i = list_i + 1 list[list_i] = v end return table.concat(list, sep, i, j) end --[[ -- Finds the length of an array, or of a quasi-array with keys such -- as "data1", "data2", etc., using an exponential search algorithm. -- It is similar to the operator #, but may return -- a different value when there are gaps in the array portion of the table. -- Intended to be used on data loaded with mw.loadData. For other tables, use #. -- Note: #frame.args in frame object always be set to 0, regardless of -- the number of unnamed template parameters, so use this function for -- frame.args. --]] function p.length(t, prefix) -- requiring module inline so that [[Module:Exponential search]] -- which is only needed by this one function -- doesn't get millions of transclusions local expSearch = require("Module:Exponential search") checkType('length', 1, t, 'table') checkType('length', 2, prefix, 'string', true) return expSearch(function(i) local key if prefix then key = prefix .. tostring(i) else key = i end return t[key] ~= nil end) or 0 end function p.inArray(arr, valueToFind) checkType("inArray", 1, arr, "table") -- if valueToFind is nil, error? for _, v in ipairs(arr) do if v == valueToFind then return true end end return false end return p ad3062fee63cdfb979a1543abf96236cf7bf609d モジュール:String 828 14 41 40 2024-02-09T10:36:30Z Kyushujin 2 1版 をインポートしました Scribunto text/plain --[[ This module is intended to provide access to basic string functions. Most of the functions provided here can be invoked with named parameters, unnamed parameters, or a mixture. If named parameters are used, Mediawiki will automatically remove any leading or trailing whitespace from the parameter. Depending on the intended use, it may be advantageous to either preserve or remove such whitespace. Global options ignore_errors: If set to 'true' or 1, any error condition will result in an empty string being returned rather than an error message. error_category: If an error occurs, specifies the name of a category to include with the error message. The default category is [Category:モジュールStringのエラー]. no_category: If set to 'true' or 1, no category will be added if an error is generated. Unit tests for this module are available at Module:String/tests. ]] local str = {} --[[ len This function returns the length of the target string. Usage: {{#invoke:String|len|target_string|}} OR {{#invoke:String|len|s=target_string}} Parameters s: The string whose length to report If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the target string. ]] function str.len( frame ) local new_args = str._getParameters( frame.args, {'s'} ) local s = new_args['s'] or '' return mw.ustring.len( s ) end --[[ sub This function returns a substring of the target string at specified indices. Usage: {{#invoke:String|sub|target_string|start_index|end_index}} OR {{#invoke:String|sub|s=target_string|i=start_index|j=end_index}} Parameters s: The string to return a subset of i: The fist index of the substring to return, defaults to 1. j: The last index of the string to return, defaults to the last character. The first character of the string is assigned an index of 1. If either i or j is a negative value, it is interpreted the same as selecting a character by counting from the end of the string. Hence, a value of -1 is the same as selecting the last character of the string. If the requested indices are out of range for the given string, an error is reported. ]] function str.sub( frame ) local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } ) local s = new_args['s'] or '' local i = tonumber( new_args['i'] ) or 1 local j = tonumber( new_args['j'] ) or -1 local len = mw.ustring.len( s ) -- Convert negatives for range checking if i < 0 then i = len + i + 1 end if j < 0 then j = len + j + 1 end if i > len or j > len or i < 1 or j < 1 then return str._error( 'String subset index out of range' ) end if j < i then return str._error( 'String subset indices out of order' ) end return mw.ustring.sub( s, i, j ) end --[[ This function implements that features of {{str sub old}} and is kept in order to maintain these older templates. ]] function str.sublength( frame ) local i = tonumber( frame.args.i ) or 0 local len = tonumber( frame.args.len ) return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) ) end --[[ _match This function returns a substring from the source string that matches a specified pattern. It is exported for use in other modules Usage: strmatch = require("Module:String")._match sresult = strmatch( s, pattern, start, match, plain, nomatch ) Parameters s: The string to search pattern: The pattern or string to find within the string start: The index within the source string to start the search. The first character of the string has index 1. Defaults to 1. match: In some cases it may be possible to make multiple matches on a single string. This specifies which match to return, where the first match is match= 1. If a negative number is specified then a match is returned counting from the last match. Hence match = -1 is the same as requesting the last match. Defaults to 1. plain: A flag indicating that the pattern should be understood as plain text. Defaults to false. nomatch: If no match is found, output the "nomatch" value rather than an error. For information on constructing Lua patterns, a form of [regular expression], see: * http://www.lua.org/manual/5.1/manual.html#5.4.1 * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns ]] -- This sub-routine is exported for use in other modules function str._match( s, pattern, start, match_index, plain_flag, nomatch ) if s == '' then return str._error( 'Target string is empty' ) end if pattern == '' then return str._error( 'Pattern string is empty' ) end start = tonumber(start) or 1 if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then return str._error( 'Requested start is out of range' ) end if match_index == 0 then return str._error( 'Match index is out of range' ) end if plain_flag then pattern = str._escapePattern( pattern ) end local result if match_index == 1 then -- Find first match is simple case result = mw.ustring.match( s, pattern, start ) else if start > 1 then s = mw.ustring.sub( s, start ) end local iterator = mw.ustring.gmatch(s, pattern) if match_index > 0 then -- Forward search for w in iterator do match_index = match_index - 1 if match_index == 0 then result = w break end end else -- Reverse search local result_table = {} local count = 1 for w in iterator do result_table[count] = w count = count + 1 end result = result_table[ count + match_index ] end end if result == nil then if nomatch == nil then return str._error( 'Match not found' ) else return nomatch end else return result end end --[[ match This function returns a substring from the source string that matches a specified pattern. Usage: {{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}} OR {{#invoke:String|match|s=source_string|pattern=pattern_string|start=start_index |match=match_number|plain=plain_flag|nomatch=nomatch_output}} Parameters s: The string to search pattern: The pattern or string to find within the string start: The index within the source string to start the search. The first character of the string has index 1. Defaults to 1. match: In some cases it may be possible to make multiple matches on a single string. This specifies which match to return, where the first match is match= 1. If a negative number is specified then a match is returned counting from the last match. Hence match = -1 is the same as requesting the last match. Defaults to 1. plain: A flag indicating that the pattern should be understood as plain text. Defaults to false. nomatch: If no match is found, output the "nomatch" value rather than an error. If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from each string. In some circumstances this is desirable, in other cases one may want to preserve the whitespace. If the match_number or start_index are out of range for the string being queried, then this function generates an error. An error is also generated if no match is found. If one adds the parameter ignore_errors=true, then the error will be suppressed and an empty string will be returned on any failure. For information on constructing Lua patterns, a form of [regular expression], see: * http://www.lua.org/manual/5.1/manual.html#5.4.1 * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns ]] -- This is the entry point for #invoke:String|match function str.match( frame ) local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} ) local s = new_args['s'] or '' local start = tonumber( new_args['start'] ) or 1 local plain_flag = str._getBoolean( new_args['plain'] or false ) local pattern = new_args['pattern'] or '' local match_index = math.floor( tonumber(new_args['match']) or 1 ) local nomatch = new_args['nomatch'] return str._match( s, pattern, start, match_index, plain_flag, nomatch ) end --[[ pos This function returns a single character from the target string at position pos. Usage: {{#invoke:String|pos|target_string|index_value}} OR {{#invoke:String|pos|target=target_string|pos=index_value}} Parameters target: The string to search pos: The index for the character to return If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the target string. In some circumstances this is desirable, in other cases one may want to preserve the whitespace. The first character has an index value of 1. If one requests a negative value, this function will select a character by counting backwards from the end of the string. In other words pos = -1 is the same as asking for the last character. A requested value of zero, or a value greater than the length of the string returns an error. ]] function str.pos( frame ) local new_args = str._getParameters( frame.args, {'target', 'pos'} ) local target_str = new_args['target'] or '' local pos = tonumber( new_args['pos'] ) or 0 if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then return str._error( 'String index out of range' ) end return mw.ustring.sub( target_str, pos, pos ) end --[[ str_find This function duplicates the behavior of {{str_find}}, including all of its quirks. This is provided in order to support existing templates, but is NOT RECOMMENDED for new code and templates. New code is recommended to use the "find" function instead. Returns the first index in "source" that is a match to "target". Indexing is 1-based, and the function returns -1 if the "target" string is not present in "source". Important Note: If the "target" string is empty / missing, this function returns a value of "1", which is generally unexpected behavior, and must be accounted for separatetly. ]] function str.str_find( frame ) local new_args = str._getParameters( frame.args, {'source', 'target'} ) local source_str = new_args['source'] or '' local target_str = new_args['target'] or '' if target_str == '' then return 1 end local start = mw.ustring.find( source_str, target_str, 1, true ) if start == nil then start = -1 end return start end --[[ find This function allows one to search for a target string or pattern within another string. Usage: {{#invoke:String|find|source_str|target_string|start_index|plain_flag}} OR {{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}} Parameters source: The string to search target: The string or pattern to find within source start: The index within the source string to start the search, defaults to 1 plain: Boolean flag indicating that target should be understood as plain text and not as a Lua style regular expression, defaults to true If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the parameter. In some circumstances this is desirable, in other cases one may want to preserve the whitespace. This function returns the first index >= "start" where "target" can be found within "source". Indices are 1-based. If "target" is not found, then this function returns 0. If either "source" or "target" are missing / empty, this function also returns 0. This function should be safe for UTF-8 strings. ]] function str.find( frame ) local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } ) local source_str = new_args['source'] or '' local pattern = new_args['target'] or '' local start_pos = tonumber(new_args['start']) or 1 local plain = new_args['plain'] or true if source_str == '' or pattern == '' then return 0 end plain = str._getBoolean( plain ) local start = mw.ustring.find( source_str, pattern, start_pos, plain ) if start == nil then start = 0 end return start end --[[ replace This function allows one to replace a target string or pattern within another string. Usage: {{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}} OR {{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string| count=replacement_count|plain=plain_flag}} Parameters source: The string to search pattern: The string or pattern to find within source replace: The replacement text count: The number of occurences to replace, defaults to all. plain: Boolean flag indicating that pattern should be understood as plain text and not as a Lua style regular expression, defaults to true ]] function str.replace( frame ) local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } ) local source_str = new_args['source'] or '' local pattern = new_args['pattern'] or '' local replace = new_args['replace'] or '' local count = tonumber( new_args['count'] ) local plain = new_args['plain'] or true if source_str == '' or pattern == '' then return source_str end plain = str._getBoolean( plain ) if plain then pattern = str._escapePattern( pattern ) replace = mw.ustring.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences. end local result if count ~= nil then result = mw.ustring.gsub( source_str, pattern, replace, count ) else result = mw.ustring.gsub( source_str, pattern, replace ) end return result end --[[ simple function to pipe string.rep to templates. ]] function str.rep( frame ) local repetitions = tonumber( frame.args[2] ) if not repetitions then return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' ) end return string.rep( frame.args[1] or '', repetitions ) end --[[ escapePattern This function escapes special characters from a Lua string pattern. See [1] for details on how patterns work. [1] https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns Usage: {{#invoke:String|escapePattern|pattern_string}} Parameters pattern_string: The pattern string to escape. ]] function str.escapePattern( frame ) local pattern_str = frame.args[1] if not pattern_str then return str._error( 'No pattern string specified' ) end local result = str._escapePattern( pattern_str ) return result end --[[ count This function counts the number of occurrences of one string in another. ]] function str.count(frame) local args = str._getParameters(frame.args, {'source', 'pattern', 'plain'}) local source = args.source or '' local pattern = args.pattern or '' local plain = str._getBoolean(args.plain or true) if plain then pattern = str._escapePattern(pattern) end local _, count = mw.ustring.gsub(source, pattern, '') return count end --[[ endswith This function determines whether a string ends with another string. ]] function str.endswith(frame) local args = str._getParameters(frame.args, {'source', 'pattern'}) local source = args.source or '' local pattern = args.pattern or '' if pattern == '' then -- All strings end with the empty string. return "yes" end if mw.ustring.sub(source, -mw.ustring.len(pattern), -1) == pattern then return "yes" else return "" end end --[[ join Join all non empty arguments together; the first argument is the separator. Usage: {{#invoke:String|join|sep|one|two|three}} ]] function str.join(frame) local args = {} local sep for _, v in ipairs( frame.args ) do if sep then if v ~= '' then table.insert(args, v) end else sep = v end end return table.concat( args, sep or '' ) end --[[ Helper function that populates the argument list given that user may need to use a mix of named and unnamed parameters. This is relevant because named parameters are not identical to unnamed parameters due to string trimming, and when dealing with strings we sometimes want to either preserve or remove that whitespace depending on the application. ]] function str._getParameters( frame_args, arg_list ) local new_args = {} local index = 1 local value for _, arg in ipairs( arg_list ) do value = frame_args[arg] if value == nil then value = frame_args[index] index = index + 1 end new_args[arg] = value end return new_args end --[[ Helper function to handle error messages. ]] function str._error( error_str ) local frame = mw.getCurrentFrame() local error_category = frame.args.error_category or 'モジュールStringのエラー' local ignore_errors = frame.args.ignore_errors or false local no_category = frame.args.no_category or false if str._getBoolean(ignore_errors) then return '' end local error_str = '<strong class="error">モジュールStringのエラー: ' .. error_str .. '</strong>' if error_category ~= '' and not str._getBoolean( no_category ) then error_str = '[[Category:' .. error_category .. ']]' .. error_str end return error_str end --[[ Helper Function to interpret boolean strings ]] function str._getBoolean( boolean_str ) local boolean_value if type( boolean_str ) == 'string' then boolean_str = boolean_str:lower() if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0' or boolean_str == '' then boolean_value = false else boolean_value = true end elseif type( boolean_str ) == 'boolean' then boolean_value = boolean_str else error( 'No boolean value found' ) end return boolean_value end --[[ Helper function that escapes all pattern characters so that they will be treated as plain text. ]] function str._escapePattern( pattern_str ) return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" ) end return str e8c19fe00abea312d12f4cedce55de799764d7fc モジュール:IsValidPageName 828 15 43 42 2024-02-09T10:36:30Z Kyushujin 2 1版 をインポートしました Scribunto text/plain -- このモジュールは [[Template:IsValidPageName]] の実体です。 local export = {} function export.isValidPageName(frame) local success, res = pcall(mw.title.new, frame.args[1]) if success and res then return "valid" else return "" end end return export b01c327f3fabc62e4d05a7377fc6d5da2ed5bb28 テンプレート:Tl 10 16 45 44 2024-02-09T10:36:31Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki &#123;&#123;[[Template:{{{1}}}|{{{1}}}]]&#125;&#125;<noinclude> {{documentation}} <!-- カテゴリと言語間リンクはここではなく、/doc サブページに追加してください --> </noinclude> 4fe179483869fa14fdbfcbafea3a0a99569d80c8 モジュール:Message box 828 17 47 46 2024-02-09T10:36:31Z Kyushujin 2 1版 をインポートしました Scribunto text/plain require('strict') local getArgs local yesno = require('Module:Yesno') local lang = mw.language.getContentLanguage() local CONFIG_MODULE = 'Module:Message box/configuration' local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'} -------------------------------------------------------------------------------- -- Helper functions -------------------------------------------------------------------------------- local function getTitleObject(...) -- Get the title object, passing the function through pcall -- in case we are over the expensive function count limit. local success, title = pcall(mw.title.new, ...) if success then return title end end local function union(t1, t2) -- Returns the union of two arrays. local vals = {} for i, v in ipairs(t1) do vals[v] = true end for i, v in ipairs(t2) do vals[v] = true end local ret = {} for k in pairs(vals) do table.insert(ret, k) end table.sort(ret) return ret end local function getArgNums(args, prefix) local nums = {} for k, v in pairs(args) do local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$') if num then table.insert(nums, tonumber(num)) end end table.sort(nums) return nums end -------------------------------------------------------------------------------- -- Box class definition -------------------------------------------------------------------------------- local MessageBox = {} MessageBox.__index = MessageBox function MessageBox.new(boxType, args, cfg) args = args or {} local obj = {} -- Set the title object and the namespace. obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle() -- Set the config for our box type. obj.cfg = cfg[boxType] if not obj.cfg then local ns = obj.title.namespace -- boxType is "mbox" or invalid input if args.demospace and args.demospace ~= '' then -- implement demospace parameter of mbox local demospace = string.lower(args.demospace) if DEMOSPACES[demospace] then -- use template from DEMOSPACES obj.cfg = cfg[DEMOSPACES[demospace]] elseif string.find( demospace, 'talk' ) then -- demo as a talk page obj.cfg = cfg.tmbox else -- default to ombox obj.cfg = cfg.ombox end elseif ns == 0 then obj.cfg = cfg.ambox -- main namespace elseif ns == 6 then obj.cfg = cfg.imbox -- file namespace elseif ns == 14 then obj.cfg = cfg.cmbox -- category namespace else local nsTable = mw.site.namespaces[ns] if nsTable and nsTable.isTalk then obj.cfg = cfg.tmbox -- any talk namespace else obj.cfg = cfg.ombox -- other namespaces or invalid input end end end -- Set the arguments, and remove all blank arguments except for the ones -- listed in cfg.allowBlankParams. do local newArgs = {} for k, v in pairs(args) do if v ~= '' then newArgs[k] = v end end for i, param in ipairs(obj.cfg.allowBlankParams or {}) do newArgs[param] = args[param] end obj.args = newArgs end -- Define internal data structure. obj.categories = {} obj.classes = {} -- For lazy loading of [[Module:Category handler]]. obj.hasCategories = false return setmetatable(obj, MessageBox) end function MessageBox:addCat(ns, cat, sort) if not cat then return nil end if sort then cat = string.format('[[Category:%s|%s]]', cat, sort) else cat = string.format('[[Category:%s]]', cat) end self.hasCategories = true self.categories[ns] = self.categories[ns] or {} table.insert(self.categories[ns], cat) end function MessageBox:addClass(class) if not class then return nil end table.insert(self.classes, class) end function MessageBox:setParameters() local args = self.args local cfg = self.cfg -- Get type data. self.type = args.type local typeData = cfg.types[self.type] self.invalidTypeError = cfg.showInvalidTypeError and self.type and not typeData typeData = typeData or cfg.types[cfg.default] self.typeClass = typeData.class self.typeImage = typeData.image -- Find if the box has been wrongly substituted. self.isSubstituted = cfg.substCheck and args.subst == 'SUBST' -- Find whether we are using a small message box. self.isSmall = cfg.allowSmall and ( cfg.smallParam and args.small == cfg.smallParam or not cfg.smallParam and yesno(args.small) ) -- Add attributes, classes and styles. self.id = args.id self.name = args.name if self.name then self:addClass('box-' .. string.gsub(self.name,' ','_')) end if yesno(args.plainlinks) ~= false then self:addClass('plainlinks') end for _, class in ipairs(cfg.classes or {}) do self:addClass(class) end if self.isSmall then self:addClass(cfg.smallClass or 'mbox-small') end self:addClass(self.typeClass) self:addClass(args.class) self.style = args.style self.attrs = args.attrs -- Set text style. self.textstyle = args.textstyle -- Find if we are on the template page or not. This functionality is only -- used if useCollapsibleTextFields is set, or if both cfg.templateCategory -- and cfg.templateCategoryRequireName are set. self.useCollapsibleTextFields = cfg.useCollapsibleTextFields if self.useCollapsibleTextFields or cfg.templateCategory and cfg.templateCategoryRequireName then if self.name then local templateName = mw.ustring.match( self.name, '^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$' ) or self.name templateName = 'Template:' .. templateName self.templateTitle = getTitleObject(templateName) end self.isTemplatePage = self.templateTitle and mw.title.equals(self.title, self.templateTitle) end -- Process data for collapsible text fields. At the moment these are only -- used in {{ambox}}. if self.useCollapsibleTextFields then -- Get the self.issue value. if self.isSmall and args.smalltext then self.issue = args.smalltext else local sect if args.sect == '' then sect = 'This ' .. (cfg.sectionDefault or 'page') elseif type(args.sect) == 'string' then sect = 'This ' .. args.sect end local issue = args.issue issue = type(issue) == 'string' and issue ~= '' and issue or nil local text = args.text text = type(text) == 'string' and text or nil local issues = {} table.insert(issues, sect) table.insert(issues, issue) table.insert(issues, text) self.issue = table.concat(issues, ' ') end -- Get the self.talk value. local talk = args.talk -- Show talk links on the template page or template subpages if the talk -- parameter is blank. if talk == '' and self.templateTitle and ( mw.title.equals(self.templateTitle, self.title) or self.title:isSubpageOf(self.templateTitle) ) then talk = '#' elseif talk == '' then talk = nil end if talk then -- If the talk value is a talk page, make a link to that page. Else -- assume that it's a section heading, and make a link to the talk -- page of the current page with that section heading. local talkTitle = getTitleObject(talk) local talkArgIsTalkPage = true if not talkTitle or not talkTitle.isTalkPage then talkArgIsTalkPage = false talkTitle = getTitleObject( self.title.text, mw.site.namespaces[self.title.namespace].talk.id ) end if talkTitle and talkTitle.exists then local talkText if self.isSmall then local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk) talkText = string.format('([[%s|ノート]])', talkLink) else talkText = '関連議論は' if talkArgIsTalkPage then talkText = string.format( '%s[[%s|%s]]に存在するかもしれません。', talkText, talk, talkTitle.prefixedText ) else talkText = string.format( '%s[[%s#%s|ノートページ]]に存在するかもしれません。', talkText, talkTitle.prefixedText, talk ) end end self.talk = talkText end end -- Get other values. self.fix = args.fix ~= '' and args.fix or nil local date if args.date and args.date ~= '' then date = args.date elseif args.date == '' and self.isTemplatePage then date = lang:formatDate('Y年F') end if date then self.date = string.format("<span class='date-container'>(<span class='date'>%s</span>)</span>", date) end self.info = args.info if yesno(args.removalnotice) then self.removalNotice = cfg.removalNotice end end -- Set the non-collapsible text field. At the moment this is used by all box -- types other than ambox, and also by ambox when small=yes. if self.isSmall then self.text = args.smalltext or args.text else self.text = args.text end -- Set the below row. self.below = cfg.below and args.below -- General image settings. self.imageCellDiv = not self.isSmall and cfg.imageCellDiv self.imageEmptyCell = cfg.imageEmptyCell -- Left image settings. local imageLeft = self.isSmall and args.smallimage or args.image if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none' or not cfg.imageCheckBlank and imageLeft ~= 'none' then self.imageLeft = imageLeft if not imageLeft then local imageSize = self.isSmall and (cfg.imageSmallSize or '30x30px') or '40x40px' self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage or 'Imbox notice.png', imageSize) end end -- Right image settings. local imageRight = self.isSmall and args.smallimageright or args.imageright if not (cfg.imageRightNone and imageRight == 'none') then self.imageRight = imageRight end -- set templatestyles self.base_templatestyles = cfg.templatestyles self.templatestyles = args.templatestyles end function MessageBox:setMainspaceCategories() local args = self.args local cfg = self.cfg if not cfg.allowMainspaceCategories then return nil end local nums = {} for _, prefix in ipairs{'cat', 'category', 'all'} do args[prefix .. '1'] = args[prefix] nums = union(nums, getArgNums(args, prefix)) end -- The following is roughly equivalent to the old {{Ambox/category}}. local date = args.date date = type(date) == 'string' and date local preposition = '/' for _, num in ipairs(nums) do local mainCat = args['cat' .. tostring(num)] or args['category' .. tostring(num)] local allCat = args['all' .. tostring(num)] mainCat = type(mainCat) == 'string' and mainCat allCat = type(allCat) == 'string' and allCat if mainCat and date and date ~= '' then local catTitle = string.format('%s%s%s', mainCat, preposition, date) self:addCat(0, catTitle) catTitle = getTitleObject('Category:' .. catTitle) if not catTitle or not catTitle.exists then self:addCat(0, '貼り付け日が正しくないテンプレートのある記事') end elseif mainCat and (not date or date == '') then self:addCat(0, mainCat) end if allCat then self:addCat(0, allCat) end end end function MessageBox:setTemplateCategories() local args = self.args local cfg = self.cfg -- Add template categories. if cfg.templateCategory then if cfg.templateCategoryRequireName then if self.isTemplatePage then self:addCat(10, cfg.templateCategory) end elseif not self.title.isSubpage then self:addCat(10, cfg.templateCategory) end end -- Add template error categories. if cfg.templateErrorCategory then local templateErrorCategory = cfg.templateErrorCategory local templateCat, templateSort if not self.name and not self.title.isSubpage then templateCat = templateErrorCategory elseif self.isTemplatePage then local paramsToCheck = cfg.templateErrorParamsToCheck or {} local count = 0 for i, param in ipairs(paramsToCheck) do if not args[param] then count = count + 1 end end if count > 0 then templateCat = templateErrorCategory templateSort = tostring(count) end if self.categoryNums and #self.categoryNums > 0 then templateCat = templateErrorCategory templateSort = 'C' end end self:addCat(10, templateCat, templateSort) end end function MessageBox:setAllNamespaceCategories() -- Set categories for all namespaces. if self.invalidTypeError then local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText self:addCat('all', 'パラメータの修正が必要なメッセージボックス', allSort) end if self.isSubstituted then self:addCat('all', '正しく置き換えられていないテンプレートがあるページ') end end function MessageBox:setCategories() if self.title.namespace == 0 then self:setMainspaceCategories() elseif self.title.namespace == 10 then self:setTemplateCategories() end self:setAllNamespaceCategories() end function MessageBox:renderCategories() if not self.hasCategories then -- No categories added, no need to pass them to Category handler so, -- if it was invoked, it would return the empty string. -- So we shortcut and return the empty string. return "" end -- Convert category tables to strings and pass them through -- [[Module:Category handler]]. return require('Module:Category handler')._main{ main = table.concat(self.categories[0] or {}), template = table.concat(self.categories[10] or {}), all = table.concat(self.categories.all or {}), nocat = self.args.nocat, page = self.args.page } end function MessageBox:export() local root = mw.html.create() -- Add the subst check error. if self.isSubstituted and self.name then root:tag('b') :addClass('error') :wikitext(string.format( 'テンプレート<code>%s[[Template:%s|%s]]%s</code>が正しく置き換えられませんでした。', mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}') )) end local frame = mw.getCurrentFrame() root:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = self.base_templatestyles }, }) -- Add support for a single custom templatestyles sheet. Undocumented as -- need should be limited and many templates using mbox are substed; we -- don't want to spread templatestyles sheets around to arbitrary places if self.templatestyles then root:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = self.templatestyles }, }) end -- Create the box table. local boxTable = root:tag('table') boxTable:attr('id', self.id or nil) for i, class in ipairs(self.classes or {}) do boxTable:addClass(class or nil) end boxTable :cssText(self.style or nil) :attr('role', 'presentation') if self.attrs then boxTable:attr(self.attrs) end -- Add the left-hand image. local row = boxTable:tag('tr') if self.imageLeft then local imageLeftCell = row:tag('td'):addClass('mbox-image') if self.imageCellDiv then -- If we are using a div, redefine imageLeftCell so that the image -- is inside it. Divs use style="width: 52px;", which limits the -- image width to 52px. If any images in a div are wider than that, -- they may overlap with the text or cause other display problems. imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div') end imageLeftCell:wikitext(self.imageLeft or nil) elseif self.imageEmptyCell then -- Some message boxes define an empty cell if no image is specified, and -- some don't. The old template code in templates where empty cells are -- specified gives the following hint: "No image. Cell with some width -- or padding necessary for text cell to have 100% width." row:tag('td') :addClass('mbox-empty-cell') end -- Add the text. local textCell = row:tag('td'):addClass('mbox-text') if self.useCollapsibleTextFields then -- The message box uses advanced text parameters that allow things to be -- collapsible. At the moment, only ambox uses this. textCell:cssText(self.textstyle or nil) local textCellDiv = textCell:tag('div') textCellDiv :addClass('mbox-text-span') :wikitext(self.issue or nil) if (self.talk or self.fix) then textCellDiv:tag('span') :addClass('hide-when-compact') :wikitext(self.talk and (self.talk) or nil) :wikitext(self.fix and (self.fix) or nil) end textCellDiv:wikitext(self.date or nil) if self.info and not self.isSmall then textCellDiv :tag('span') :addClass('hide-when-compact') :wikitext(self.info and (' ' .. self.info) or nil) end if self.removalNotice then textCellDiv:tag('span') :addClass('hide-when-compact') :tag('i') :wikitext(string.format(" (%s)", self.removalNotice)) end else -- Default text formatting - anything goes. textCell :cssText(self.textstyle or nil) :wikitext(self.text or nil) end -- Add the right-hand image. if self.imageRight then local imageRightCell = row:tag('td'):addClass('mbox-imageright') if self.imageCellDiv then -- If we are using a div, redefine imageRightCell so that the image -- is inside it. imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div') end imageRightCell :wikitext(self.imageRight or nil) end -- Add the below row. if self.below then boxTable:tag('tr') :tag('td') :attr('colspan', self.imageRight and '3' or '2') :addClass('mbox-text') :cssText(self.textstyle or nil) :wikitext(self.below or nil) end -- Add error message for invalid type parameters. if self.invalidTypeError then root:tag('div') :addClass('mbox-invalid-type') :wikitext(string.format( 'このメッセージボックスには無効な"type=%s"というパラメータが指定されているため修正が必要です。', self.type or '' )) end -- Add categories. root:wikitext(self:renderCategories() or nil) return tostring(root) end -------------------------------------------------------------------------------- -- Exports -------------------------------------------------------------------------------- local p, mt = {}, {} function p._exportClasses() -- For testing. return { MessageBox = MessageBox } end function p.main(boxType, args, cfgTables) local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE)) box:setParameters() box:setCategories() return box:export() end function mt.__index(t, k) return function (frame) if not getArgs then getArgs = require('Module:Arguments').getArgs end return t.main(k, getArgs(frame, {trim = false, removeBlanks = false})) end end return setmetatable(p, mt) 7a56bb4b6a0d077d0f3a07b71c8ca29282e6273a モジュール:Yesno 828 18 49 48 2024-02-09T10:36:32Z Kyushujin 2 1版 をインポートしました Scribunto text/plain -- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template {{yesno}}. return function (val, default) -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you -- should replace "val:lower()" with "mw.ustring.lower(val)" in the -- following line. val = type(val) == 'string' and val:lower() or val if val == nil then return nil elseif val == true or val == 'yes' or val == 'y' or val == 'true' or val == 't' or val == 'on' or tonumber(val) == 1 then return true elseif val == false or val == 'no' or val == 'n' or val == 'false' or val == 'f' or val == 'off' or tonumber(val) == 0 then return false else return default end end f767643e7d12126d020d88d662a3dd057817b9dc モジュール:Message box/configuration 828 19 51 50 2024-02-09T10:36:32Z Kyushujin 2 1版 をインポートしました Scribunto text/plain -------------------------------------------------------------------------------- -- Message box configuration -- -- -- -- This module contains configuration data for [[Module:Message box]]. -- -------------------------------------------------------------------------------- return { ambox = { types = { speedy = { class = 'ambox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'ambox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'ambox-content', image = 'Ambox important.svg' }, style = { class = 'ambox-style', image = 'Edit-clear.svg' }, move = { class = 'ambox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'ambox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'ambox-notice', image = 'Information icon4.svg' } }, default = 'notice', allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'}, allowSmall = true, smallParam = 'left', smallClass = 'mbox-small-left', substCheck = true, classes = {--[['metadata',]] 'ambox'}, imageEmptyCell = true, imageCheckBlank = true, imageSmallSize = '20x20px', imageCellDiv = true, useCollapsibleTextFields = true, imageRightNone = true, sectionDefault = '記事', allowMainspaceCategories = true, templateCategory = '記事メッセージボックス', templateCategoryRequireName = true, templateErrorCategory = 'パラメータ指定の無い記事メッセージボックス', templateErrorParamsToCheck = {'issue', 'fix', 'subst'}, templatestyles = 'Module:Message box/ambox.css' }, cmbox = { types = { speedy = { class = 'cmbox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'cmbox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'cmbox-content', image = 'Ambox important.svg' }, style = { class = 'cmbox-style', image = 'Edit-clear.svg' }, move = { class = 'cmbox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'cmbox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'cmbox-notice', image = 'Information icon4.svg' } }, default = 'notice', showInvalidTypeError = true, classes = {'cmbox'}, imageEmptyCell = true, templatestyles = 'Module:Message box/cmbox.css' }, fmbox = { types = { warning = { class = 'fmbox-warning', image = 'Ambox warning pn.svg' }, editnotice = { class = 'fmbox-editnotice', image = 'Information icon4.svg' }, system = { class = 'fmbox-system', image = 'Information icon4.svg' } }, default = 'system', showInvalidTypeError = true, classes = {'fmbox'}, imageEmptyCell = false, imageRightNone = false, templatestyles = 'Module:Message box/fmbox.css' }, imbox = { types = { speedy = { class = 'imbox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'imbox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'imbox-content', image = 'Ambox important.svg' }, style = { class = 'imbox-style', image = 'Edit-clear.svg' }, move = { class = 'imbox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'imbox-protection', image = 'Padlock-silver-medium.svg' }, license = { class = 'imbox-license licensetpl', image = 'Imbox license.png' -- @todo We need an SVG version of this }, featured = { class = 'imbox-featured', image = 'Cscr-featured.svg' }, notice = { class = 'imbox-notice', image = 'Information icon4.svg' } }, default = 'notice', showInvalidTypeError = true, classes = {'imbox'}, imageEmptyCell = true, below = true, templateCategory = 'ファイルメッセージボックス', templatestyles = 'Module:Message box/imbox.css' }, ombox = { types = { speedy = { class = 'ombox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'ombox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'ombox-content', image = 'Ambox important.svg' }, style = { class = 'ombox-style', image = 'Edit-clear.svg' }, move = { class = 'ombox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'ombox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'ombox-notice', image = 'Information icon4.svg' } }, default = 'notice', showInvalidTypeError = true, classes = {'ombox'}, allowSmall = true, imageEmptyCell = true, imageRightNone = true, templatestyles = 'Module:Message box/ombox.css' }, tmbox = { types = { speedy = { class = 'tmbox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'tmbox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'tmbox-content', image = 'Ambox important.svg' }, style = { class = 'tmbox-style', image = 'Edit-clear.svg' }, move = { class = 'tmbox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'tmbox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'tmbox-notice', image = 'Information icon4.svg' } }, default = 'notice', showInvalidTypeError = true, classes = {'tmbox'}, allowSmall = true, imageRightNone = true, imageEmptyCell = true, templateCategory = 'ノートページメッセージボックス', templatestyles = 'Module:Message box/tmbox.css' } } e22b1a5ebead175963172bf52fb102c8b826cd07 テンプレート:See/core 10 20 53 52 2024-02-09T10:36:32Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{#invoke:See/core|GetLink|{{{1}}}|{{{2|}}}}}<noinclude> {{pp-template}} [[Category:内部テンプレート|{{PAGENAME}}]] </noinclude> 6c813fe73a4f973653045e7fa48eca46bcf83999 モジュール:See/core 828 21 55 54 2024-02-09T10:36:33Z Kyushujin 2 1版 をインポートしました Scribunto text/plain local p = {} function p.GetLink(frame) local link = frame.args[1] local display = frame.args[2] -- 第一引数の値が技術的に利用可能な記事名でない場合、 -- 第一引数の値をそのまま返す local IsValidPageName = require('モジュール:IsValidPageName') if IsValidPageName.isValidPageName(frame) == "" then return link end if display == "" then display = nil end return p._formatLink(link, display) end function p._formatLink(link, display) -- Remove the initial colon for links where it was specified manually. link = link:match('^:?(.*)') -- Find whether a faux display value has been added with the {{!}} magic -- word. if not display then local prePipe, postPipe = link:match('^(.-)|(.*)$') link = prePipe or link display = postPipe end -- Assemble the link. if display then return string.format( '[[:%s|%s]]', string.gsub(link, '|(.*)$', ''), --display overwrites manual piping display ) else return string.format('[[:%s]]', link) end end return p 248d13358e47b444219b6c009d1ae15bb4c41b43 モジュール:List 828 22 57 56 2024-02-09T10:36:33Z Kyushujin 2 1版 をインポートしました Scribunto text/plain local libUtil = require('libraryUtil') local checkType = libUtil.checkType local mTableTools = require('Module:TableTools') local p = {} local listTypes = { ['bulleted'] = true, ['unbulleted'] = true, ['horizontal'] = true, ['ordered'] = true, ['horizontal_ordered'] = true } function p.makeListData(listType, args) -- Constructs a data table to be passed to p.renderList. local data = {} -- Classes and TemplateStyles data.classes = {} data.templatestyles = '' if listType == 'horizontal' or listType == 'horizontal_ordered' then table.insert(data.classes, 'hlist') data.templatestyles = mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = 'Hlist/styles.css' } } elseif listType == 'unbulleted' then table.insert(data.classes, 'plainlist') data.templatestyles = mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = 'Plainlist/styles.css' } } end table.insert(data.classes, args.class) -- Main div style data.style = args.style -- Indent for horizontal lists if listType == 'horizontal' or listType == 'horizontal_ordered' then local indent = tonumber(args.indent) indent = indent and indent * 1.6 or 0 if indent > 0 then data.marginLeft = indent .. 'em' end end -- List style types for ordered lists -- This could be "1, 2, 3", "a, b, c", or a number of others. The list style -- type is either set by the "type" attribute or the "list-style-type" CSS -- property. if listType == 'ordered' or listType == 'horizontal_ordered' then data.listStyleType = args.list_style_type or args['list-style-type'] data.type = args['type'] -- Detect invalid type attributes and attempt to convert them to -- list-style-type CSS properties. if data.type and not data.listStyleType and not tostring(data.type):find('^%s*[1AaIi]%s*$') then data.listStyleType = data.type data.type = nil end end -- List tag type if listType == 'ordered' or listType == 'horizontal_ordered' then data.listTag = 'ol' else data.listTag = 'ul' end -- Start number for ordered lists data.start = args.start if listType == 'horizontal_ordered' then -- Apply fix to get start numbers working with horizontal ordered lists. local startNum = tonumber(data.start) if startNum then data.counterReset = 'listitem ' .. tostring(startNum) data.counterIncrement = 'listitem -1' end end -- List style -- ul_style and ol_style are included for backwards compatibility. No -- distinction is made for ordered or unordered lists. data.listStyle = args.list_style -- List items -- li_style is included for backwards compatibility. item_style was included -- to be easier to understand for non-coders. data.itemStyle = args.item_style or args.li_style data.items = {} for _, num in ipairs(mTableTools.numKeys(args)) do local item = {} item.content = args[num] item.style = args['item' .. tostring(num) .. '_style'] or args['item_style' .. tostring(num)] item.value = args['item' .. tostring(num) .. '_value'] or args['item_value' .. tostring(num)] if item.value ~= nil then item.style = 'counter-reset: listitem ' .. item.value .. ';counter-increment: none;' .. ((item.style) or '') end table.insert(data.items, item) end return data end function p.renderList(data) -- Renders the list HTML. -- Return the blank string if there are no list items. if type(data.items) ~= 'table' or #data.items < 1 then return '' end -- Render the main div tag. local root = mw.html.create('div') for _, class in ipairs(data.classes or {}) do root:addClass(class) end root:css{['margin-left'] = data.marginLeft} if data.style then root:cssText(data.style) end -- Render the list tag. local list = root:tag(data.listTag or 'ul') list :attr{start = data.start, type = data.type} :css{ ['counter-reset'] = data.counterReset, ['counter-increment'] = data.counterIncrement, ['list-style-type'] = data.listStyleType } if data.listStyle then list:cssText(data.listStyle) end -- Render the list items for _, t in ipairs(data.items or {}) do local item = list:tag('li') if data.itemStyle then item:cssText(data.itemStyle) end if t.style then item:cssText(t.style) end item :attr{value = t.value} :wikitext(t.content) end return data.templatestyles .. tostring(root) end function p.renderTrackingCategories(args) local isDeprecated = false -- Tracks deprecated parameters. for k, v in pairs(args) do k = tostring(k) if k:find('^item_style%d+$') or k:find('^item_value%d+$') then isDeprecated = true break end end local ret = '' if isDeprecated then ret = ret .. '[[Category:List templates with deprecated parameters]]' end return ret end function p.makeList(listType, args) if not listType or not listTypes[listType] then error(string.format( "bad argument #1 to 'makeList' ('%s' is not a valid list type)", tostring(listType) ), 2) end checkType('makeList', 2, args, 'table') local data = p.makeListData(listType, args) local list = p.renderList(data) local trackingCategories = p.renderTrackingCategories(args) return list .. trackingCategories end for listType in pairs(listTypes) do p[listType] = function (frame) local mArguments = require('Module:Arguments') local origArgs = mArguments.getArgs(frame, { valueFunc = function (key, value) if not value or not mw.ustring.find(value, '%S') then return nil end if mw.ustring.find(value, '^%s*[%*#;:]') then return value else return value:match('^%s*(.-)%s*$') end return nil end }) -- Copy all the arguments to a new table, for faster indexing. local args = {} for k, v in pairs(origArgs) do args[k] = v end return p.makeList(listType, args) end end return p 355dc4095d8b21f2bc6715f5240f1eb4ae87e63b モジュール:Protection banner 828 23 59 58 2024-02-09T10:36:33Z Kyushujin 2 1版 をインポートしました Scribunto text/plain -- This module implements {{pp-meta}} and its daughter templates such as -- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}. -- Initialise necessary modules. require('strict') local makeFileLink = require('Module:File link')._main local effectiveProtectionLevel = require('Module:Effective protection level')._main local effectiveProtectionExpiry = require('Module:Effective protection expiry')._main local yesno = require('Module:Yesno') -- Lazily initialise modules and objects we don't always need. local getArgs, makeMessageBox, lang -- Set constants. local CONFIG_MODULE = 'モジュール:Protection banner/config' -------------------------------------------------------------------------------- -- Helper functions -------------------------------------------------------------------------------- local function makeCategoryLink(cat, sort) if cat then return string.format( '[[%s:%s|%s]]', mw.site.namespaces[14].name, cat, sort ) end end -- Validation function for the expiry and the protection date local function validateDate(dateString, dateType) if not lang then lang = mw.language.getContentLanguage() end local success, result = pcall(lang.formatDate, lang, 'U', dateString) if success then result = tonumber(result) if result then return result end end error(string.format( 'invalid %s: %s', dateType, tostring(dateString) ), 4) end local function makeFullUrl(page, query, display) return string.format( '[%s %s]', tostring(mw.uri.fullUrl(page, query)), display ) end -- Given a directed graph formatted as node -> table of direct successors, -- get a table of all nodes reachable from a given node (though always -- including the given node). local function getReachableNodes(graph, start) local toWalk, retval = {[start] = true}, {} while true do -- Can't use pairs() since we're adding and removing things as we're iterating local k = next(toWalk) -- This always gets the "first" key if k == nil then return retval end toWalk[k] = nil retval[k] = true for _,v in ipairs(graph[k]) do if not retval[v] then toWalk[v] = true end end end end -------------------------------------------------------------------------------- -- Protection class -------------------------------------------------------------------------------- local Protection = {} Protection.__index = Protection Protection.supportedActions = { edit = true, move = true, autoreview = true, upload = true } Protection.bannerConfigFields = { 'text', 'explanation', 'tooltip', 'alt', 'link', 'image' } function Protection.new(args, cfg, title) local obj = {} obj._cfg = cfg obj.title = title or mw.title.getCurrentTitle() -- Set action if not args.action then obj.action = 'edit' elseif Protection.supportedActions[args.action] then obj.action = args.action else error(string.format( 'invalid action: %s', tostring(args.action) ), 3) end -- Set level obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title) if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then -- Users need to be autoconfirmed to move pages anyway, so treat -- semi-move-protected pages as unprotected. obj.level = '*' end -- Set expiry local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title) if effectiveExpiry == 'infinity' then obj.expiry = 'indef' elseif effectiveExpiry ~= 'unknown' then obj.expiry = validateDate(effectiveExpiry, 'expiry date') end -- Set reason if args[1] then obj.reason = mw.ustring.lower(args[1]) if obj.reason:find('|') then error('reasons cannot contain the pipe character ("|")', 3) end end -- Set protection date if args.date then obj.protectionDate = validateDate(args.date, 'protection date') end -- Set banner config do obj.bannerConfig = {} local configTables = {} if cfg.banners[obj.action] then configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason] end if cfg.defaultBanners[obj.action] then configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level] configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default end configTables[#configTables + 1] = cfg.masterBanner for i, field in ipairs(Protection.bannerConfigFields) do for j, t in ipairs(configTables) do if t[field] then obj.bannerConfig[field] = t[field] break end end end end return setmetatable(obj, Protection) end function Protection:isProtected() return self.level ~= '*' end function Protection:isTemporary() return type(self.expiry) == 'number' end function Protection:makeProtectionCategory() local cfg = self._cfg local title = self.title -- Exit if the page is not protected. if not self:isProtected() then return '' end -- Get the expiry key fragment. local expiryFragment if self.expiry == 'indef' then expiryFragment = self.expiry elseif type(self.expiry) == 'number' then expiryFragment = 'temp' end -- Get the namespace key fragment. local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace] if not namespaceFragment and title.namespace % 2 == 1 then namespaceFragment = 'talk' end -- Define the order that key fragments are tested in. This is done with an -- array of tables containing the value to be tested, along with its -- position in the cfg.protectionCategories table. local order = { {val = expiryFragment, keypos = 1}, {val = namespaceFragment, keypos = 2}, {val = self.reason, keypos = 3}, {val = self.level, keypos = 4}, {val = self.action, keypos = 5} } --[[ -- The old protection templates used an ad-hoc protection category system, -- with some templates prioritising namespaces in their categories, and -- others prioritising the protection reason. To emulate this in this module -- we use the config table cfg.reasonsWithNamespacePriority to set the -- reasons for which namespaces have priority over protection reason. -- If we are dealing with one of those reasons, move the namespace table to -- the end of the order table, i.e. give it highest priority. If not, the -- reason should have highest priority, so move that to the end of the table -- instead. --]] table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3)) --[[ -- Define the attempt order. Inactive subtables (subtables with nil "value" -- fields) are moved to the end, where they will later be given the key -- "all". This is to cut down on the number of table lookups in -- cfg.protectionCategories, which grows exponentially with the number of -- non-nil keys. We keep track of the number of active subtables with the -- noActive parameter. --]] local noActive, attemptOrder do local active, inactive = {}, {} for i, t in ipairs(order) do if t.val then active[#active + 1] = t else inactive[#inactive + 1] = t end end noActive = #active attemptOrder = active for i, t in ipairs(inactive) do attemptOrder[#attemptOrder + 1] = t end end --[[ -- Check increasingly generic key combinations until we find a match. If a -- specific category exists for the combination of key fragments we are -- given, that match will be found first. If not, we keep trying different -- key fragment combinations until we match using the key -- "all-all-all-all-all". -- -- To generate the keys, we index the key subtables using a binary matrix -- with indexes i and j. j is only calculated up to the number of active -- subtables. For example, if there were three active subtables, the matrix -- would look like this, with 0 corresponding to the key fragment "all", and -- 1 corresponding to other key fragments. -- -- j 1 2 3 -- i -- 1 1 1 1 -- 2 0 1 1 -- 3 1 0 1 -- 4 0 0 1 -- 5 1 1 0 -- 6 0 1 0 -- 7 1 0 0 -- 8 0 0 0 -- -- Values of j higher than the number of active subtables are set -- to the string "all". -- -- A key for cfg.protectionCategories is constructed for each value of i. -- The position of the value in the key is determined by the keypos field in -- each subtable. --]] local cats = cfg.protectionCategories for i = 1, 2^noActive do local key = {} for j, t in ipairs(attemptOrder) do if j > noActive then key[t.keypos] = 'all' else local quotient = i / 2 ^ (j - 1) quotient = math.ceil(quotient) if quotient % 2 == 1 then key[t.keypos] = t.val else key[t.keypos] = 'all' end end end key = table.concat(key, '|') local attempt = cats[key] if attempt then return makeCategoryLink(attempt, title.text) end end return '' end function Protection:isIncorrect() local expiry = self.expiry return not self:isProtected() or type(expiry) == 'number' and expiry < os.time() end -- 日本語版独自 function Protection:isMismatched() return self.reason == 'dispute' and self.level ~= 'sysop' end function Protection:isTemplateProtectedNonTemplate() local action, namespace = self.action, self.title.namespace return self.level == 'templateeditor' and ( (action ~= 'edit' and action ~= 'move') or (namespace ~= 10 and namespace ~= 828) ) end function Protection:makeCategoryLinks() local msg = self._cfg.msg local ret = { self:makeProtectionCategory() } if self:isIncorrect() then ret[#ret + 1] = makeCategoryLink( msg['tracking-category-incorrect'], self.title.text ) elseif self:isMismatched() then ret[#ret + 1] = makeCategoryLink( msg['tracking-category-mismatch'], self.title.text ) end if self:isTemplateProtectedNonTemplate() then ret[#ret + 1] = makeCategoryLink( msg['tracking-category-template'], self.title.text ) end return table.concat(ret) end -------------------------------------------------------------------------------- -- Blurb class -------------------------------------------------------------------------------- local Blurb = {} Blurb.__index = Blurb Blurb.bannerTextFields = { text = true, explanation = true, tooltip = true, alt = true, link = true } function Blurb.new(protectionObj, args, cfg) return setmetatable({ _cfg = cfg, _protectionObj = protectionObj, _args = args }, Blurb) end -- Private methods -- function Blurb:_formatDate(num) -- Formats a Unix timestamp into dd Month, YYYY format. lang = lang or mw.language.getContentLanguage() local success, date = pcall( lang.formatDate, lang, self._cfg.msg['expiry-date-format'] or 'j F Y', '@' .. tostring(num) ) if success then return date end end function Blurb:_getExpandedMessage(msgKey) return self:_substituteParameters(self._cfg.msg[msgKey]) end function Blurb:_substituteParameters(msg) if not self._params then local parameterFuncs = {} parameterFuncs.CURRENTVERSION = self._makeCurrentVersionParameter parameterFuncs.EDITREQUEST = self._makeEditRequestParameter parameterFuncs.EXPIRY = self._makeExpiryParameter parameterFuncs.EXPLANATIONBLURB = self._makeExplanationBlurbParameter parameterFuncs.IMAGELINK = self._makeImageLinkParameter parameterFuncs.INTROBLURB = self._makeIntroBlurbParameter parameterFuncs.INTROFRAGMENT = self._makeIntroFragmentParameter parameterFuncs.PAGETYPE = self._makePagetypeParameter parameterFuncs.PROTECTIONBLURB = self._makeProtectionBlurbParameter parameterFuncs.PROTECTIONDATE = self._makeProtectionDateParameter parameterFuncs.PROTECTIONLEVEL = self._makeProtectionLevelParameter parameterFuncs.PROTECTIONLOG = self._makeProtectionLogParameter parameterFuncs.TALKPAGE = self._makeTalkPageParameter parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter parameterFuncs.VANDAL = self._makeVandalTemplateParameter self._params = setmetatable({}, { __index = function (t, k) local param if parameterFuncs[k] then param = parameterFuncs[k](self) end param = param or '' t[k] = param return param end }) end msg = msg:gsub('${(%u+)}', self._params) return msg end function Blurb:_makeCurrentVersionParameter() -- A link to the page history or the move log, depending on the kind of -- protection. local pagename = self._protectionObj.title.prefixedText if self._protectionObj.action == 'move' then -- We need the move log link. return makeFullUrl( 'Special:Log', {type = 'move', page = pagename}, self:_getExpandedMessage('current-version-move-display') ) else -- We need the history link. return makeFullUrl( pagename, {action = 'history'}, self:_getExpandedMessage('current-version-edit-display') ) end end function Blurb:_makeEditRequestParameter() local mEditRequest = require('Module:Submit an edit request') local action = self._protectionObj.action local level = self._protectionObj.level -- Get the edit request type. local requestType if action == 'edit' then if level == 'autoconfirmed' then requestType = 'semi' elseif level == 'extendedconfirmed' then requestType = 'extended' elseif level == 'templateeditor' then requestType = 'template' end end requestType = requestType or 'full' -- Get the display value. local display = self:_getExpandedMessage('edit-request-display') return mEditRequest._link{type = requestType, display = display} end function Blurb:_makeExpiryParameter() local expiry = self._protectionObj.expiry if type(expiry) == 'number' then return self:_formatDate(expiry) else return expiry end end function Blurb:_makeExplanationBlurbParameter() -- Cover special cases first. if self._protectionObj.title.namespace == 8 then -- MediaWiki namespace return self:_getExpandedMessage('explanation-blurb-nounprotect') end -- Get explanation blurb table keys local action = self._protectionObj.action local level = self._protectionObj.level local talkKey = self._protectionObj.title.isTalkPage and 'talk' or 'subject' -- Find the message in the explanation blurb table and substitute any -- parameters. local explanations = self._cfg.explanationBlurbs local msg if explanations[action][level] and explanations[action][level][talkKey] then msg = explanations[action][level][talkKey] elseif explanations[action][level] and explanations[action][level].default then msg = explanations[action][level].default elseif explanations[action].default and explanations[action].default[talkKey] then msg = explanations[action].default[talkKey] elseif explanations[action].default and explanations[action].default.default then msg = explanations[action].default.default else error(string.format( 'could not find explanation blurb for action "%s", level "%s" and talk key "%s"', action, level, talkKey ), 8) end return self:_substituteParameters(msg) end function Blurb:_makeImageLinkParameter() local imageLinks = self._cfg.imageLinks local action = self._protectionObj.action local level = self._protectionObj.level local msg if imageLinks[action][level] then msg = imageLinks[action][level] elseif imageLinks[action].default then msg = imageLinks[action].default else msg = imageLinks.edit.default end return self:_substituteParameters(msg) end function Blurb:_makeIntroBlurbParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('intro-blurb-expiry') else return self:_getExpandedMessage('intro-blurb-noexpiry') end end function Blurb:_makeIntroFragmentParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('intro-fragment-expiry') else return self:_getExpandedMessage('intro-fragment-noexpiry') end end function Blurb:_makePagetypeParameter() local pagetypes = self._cfg.pagetypes return pagetypes[self._protectionObj.title.namespace] or pagetypes.default or error('no default pagetype defined', 8) end function Blurb:_makeProtectionBlurbParameter() local protectionBlurbs = self._cfg.protectionBlurbs local action = self._protectionObj.action local level = self._protectionObj.level local msg if protectionBlurbs[action][level] then msg = protectionBlurbs[action][level] elseif protectionBlurbs[action].default then msg = protectionBlurbs[action].default elseif protectionBlurbs.edit.default then msg = protectionBlurbs.edit.default else error('no protection blurb defined for protectionBlurbs.edit.default', 8) end return self:_substituteParameters(msg) end function Blurb:_makeProtectionDateParameter() local protectionDate = self._protectionObj.protectionDate if type(protectionDate) == 'number' then return self:_formatDate(protectionDate) else return protectionDate end end function Blurb:_makeProtectionLevelParameter() local protectionLevels = self._cfg.protectionLevels local action = self._protectionObj.action local level = self._protectionObj.level local msg if protectionLevels[action][level] then msg = protectionLevels[action][level] elseif protectionLevels[action].default then msg = protectionLevels[action].default elseif protectionLevels.edit.default then msg = protectionLevels.edit.default else error('no protection level defined for protectionLevels.edit.default', 8) end return self:_substituteParameters(msg) end function Blurb:_makeProtectionLogParameter() local pagename = self._protectionObj.title.prefixedText if self._protectionObj.action == 'autoreview' then -- We need the pending changes log. return makeFullUrl( 'Special:Log', {type = 'stable', page = pagename}, self:_getExpandedMessage('pc-log-display') ) else -- We need the protection log. return makeFullUrl( 'Special:Log', {type = 'protect', page = pagename}, self:_getExpandedMessage('protection-log-display') ) end end function Blurb:_makeTalkPageParameter() return string.format( '[[%s:%s#%s|%s]]', mw.site.namespaces[self._protectionObj.title.namespace].talk.name, self._protectionObj.title.text, self._args.section or 'top', self:_getExpandedMessage('talk-page-link-display') ) end function Blurb:_makeTooltipBlurbParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('tooltip-blurb-expiry') else return self:_getExpandedMessage('tooltip-blurb-noexpiry') end end function Blurb:_makeTooltipFragmentParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('tooltip-fragment-expiry') else return self:_getExpandedMessage('tooltip-fragment-noexpiry') end end function Blurb:_makeVandalTemplateParameter() return require('Module:Vandal-m')._main{ self._args.user or self._protectionObj.title.baseText } end -- Public methods -- function Blurb:makeBannerText(key) -- Validate input. if not key or not Blurb.bannerTextFields[key] then error(string.format( '"%s" is not a valid banner config field', tostring(key) ), 2) end -- Generate the text. local msg = self._protectionObj.bannerConfig[key] if type(msg) == 'string' then return self:_substituteParameters(msg) elseif type(msg) == 'function' then msg = msg(self._protectionObj, self._args) if type(msg) ~= 'string' then error(string.format( 'bad output from banner config function with key "%s"' .. ' (expected string, got %s)', tostring(key), type(msg) ), 4) end return self:_substituteParameters(msg) end end -------------------------------------------------------------------------------- -- BannerTemplate class -------------------------------------------------------------------------------- local BannerTemplate = {} BannerTemplate.__index = BannerTemplate function BannerTemplate.new(protectionObj, cfg) local obj = {} obj._cfg = cfg -- Set the image filename. local imageFilename = protectionObj.bannerConfig.image if imageFilename then -- 日本語版独自の条件分岐 if type(imageFilename) == 'string' then obj._imageFilename = imageFilename elseif type(imageFilename) == 'function' then obj._imageFilename = imageFilename(protectionObj) end else -- If an image filename isn't specified explicitly in the banner config, -- generate it from the protection status and the namespace. local action = protectionObj.action local level = protectionObj.level local namespace = protectionObj.title.namespace local reason = protectionObj.reason -- Deal with special cases first. if ( namespace == 10 or namespace == 828 or reason and obj._cfg.indefImageReasons[reason] ) and action == 'edit' and level == 'sysop' and not protectionObj:isTemporary() then -- Fully protected modules and templates get the special red "indef" -- padlock. obj._imageFilename = obj._cfg.msg['image-filename-indef'] else -- Deal with regular protection types. local images = obj._cfg.images if images[action] then if images[action][level] then obj._imageFilename = images[action][level] elseif images[action].default then obj._imageFilename = images[action].default end end end end return setmetatable(obj, BannerTemplate) end function BannerTemplate:renderImage() local filename = self._imageFilename or self._cfg.msg['image-filename-default'] or 'Transparent.gif' return makeFileLink{ file = filename, size = (self.imageSize or 'x20') .. 'px', -- 日本語版独自の変更 alt = self._imageAlt, link = self._imageLink, caption = self.imageCaption } end -------------------------------------------------------------------------------- -- Banner class -------------------------------------------------------------------------------- local Banner = setmetatable({}, BannerTemplate) Banner.__index = Banner function Banner.new(protectionObj, blurbObj, cfg) local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb. obj.imageSize = 40 -- 日本語版独自の変更: フィールド名 obj.imageCaption = blurbObj:makeBannerText('alt') -- Large banners use the alt text for the tooltip. obj._reasonText = blurbObj:makeBannerText('text') obj._explanationText = blurbObj:makeBannerText('explanation') obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing. return setmetatable(obj, Banner) end function Banner:__tostring() -- Renders the banner. makeMessageBox = makeMessageBox or require('Module:Message box').main local reasonText = self._reasonText or error('no reason text set', 2) local explanationText = self._explanationText local mbargs = { page = self._page, type = 'protection', image = self:renderImage(), text = string.format( "'''%s'''%s", reasonText, explanationText and '<br />' .. explanationText or '' ) } return makeMessageBox('mbox', mbargs) end -------------------------------------------------------------------------------- -- Padlock class -------------------------------------------------------------------------------- local Padlock = setmetatable({}, BannerTemplate) Padlock.__index = Padlock function Padlock.new(protectionObj, blurbObj, cfg) local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb. obj.imageSize = 'x20' -- 日本語版独自の変更: フィールド名、高さのみ指定 obj.imageCaption = blurbObj:makeBannerText('tooltip') obj._imageAlt = blurbObj:makeBannerText('alt') obj._imageLink = blurbObj:makeBannerText('link') obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action] or cfg.padlockIndicatorNames.default or 'pp-default' return setmetatable(obj, Padlock) end function Padlock:__tostring() local frame = mw.getCurrentFrame() -- The nowiki tag helps prevent whitespace at the top of articles. return frame:extensionTag{name = 'nowiki'} .. frame:extensionTag{ name = 'indicator', args = {name = self._indicatorName}, content = self:renderImage() } end -------------------------------------------------------------------------------- -- Exports -------------------------------------------------------------------------------- local p = {} function p._exportClasses() -- This is used for testing purposes. return { Protection = Protection, Blurb = Blurb, BannerTemplate = BannerTemplate, Banner = Banner, Padlock = Padlock, } end function p._main(args, cfg, title) args = args or {} cfg = cfg or require(CONFIG_MODULE) local protectionObj = Protection.new(args, cfg, title) local ret = {} -- If a page's edit protection is equally or more restrictive than its -- protection from some other action, then don't bother displaying anything -- for the other action (except categories). if protectionObj.action == 'edit' or args.demolevel or not getReachableNodes( cfg.hierarchy, protectionObj.level )[effectiveProtectionLevel('edit', protectionObj.title)] then -- Initialise the blurb object local blurbObj = Blurb.new(protectionObj, args, cfg) -- Render the banner if protectionObj:isProtected() then ret[#ret + 1] = tostring( (yesno(args.small) and Padlock or Banner) .new(protectionObj, blurbObj, cfg) ) end end -- Render the categories if yesno(args.category) ~= false then ret[#ret + 1] = protectionObj:makeCategoryLinks() end return table.concat(ret) end function p.main(frame, cfg) cfg = cfg or require(CONFIG_MODULE) -- Find default args, if any. local parent = frame.getParent and frame:getParent() local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub('/sandbox$', '')] -- Find user args, and use the parent frame if we are being called from a -- wrapper template. getArgs = getArgs or require('Module:Arguments').getArgs local userArgs = getArgs(frame, { parentOnly = defaultArgs, frameOnly = not defaultArgs }) -- Build the args table. User-specified args overwrite default args. local args = {} for k, v in pairs(defaultArgs or {}) do args[k] = v end for k, v in pairs(userArgs) do args[k] = v end return p._main(args, cfg) end return p 4bda59115ba9b006ed3d678013dc55d2ef567dfe モジュール:File link 828 24 61 60 2024-02-09T10:36:34Z Kyushujin 2 1版 をインポートしました Scribunto text/plain -- This module provides a library for formatting file wikilinks. local yesno = require('Module:Yesno') local checkType = require('libraryUtil').checkType local p = {} function p._main(args) checkType('_main', 1, args, 'table') -- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our -- own function to get the right error level. local function checkArg(key, val, level) if type(val) ~= 'string' then error(string.format( "'_main'関数における'%s'引数のタイプエラー(想定:文字列、実際:%s)", key, type(val) ), level) end end local ret = {} -- Adds a positional parameter to the buffer. local function addPositional(key) local val = args[key] if not val then return nil end checkArg(key, val, 4) ret[#ret + 1] = val end -- Adds a named parameter to the buffer. We assume that the parameter name -- is the same as the argument key. local function addNamed(key) local val = args[key] if not val then return nil end checkArg(key, val, 4) ret[#ret + 1] = key .. '=' .. val end -- Filename checkArg('file', args.file, 3) ret[#ret + 1] = 'File:' .. args.file -- Format if args.format then checkArg('format', args.format) if args.formatfile then checkArg('formatfile', args.formatfile) ret[#ret + 1] = args.format .. '=' .. args.formatfile else ret[#ret + 1] = args.format end end -- Border if yesno(args.border) then ret[#ret + 1] = 'border' end addPositional('location') addPositional('alignment') addPositional('size') addNamed('upright') addNamed('link') addNamed('alt') addNamed('page') addNamed('class') addNamed('lang') addNamed('start') addNamed('end') addNamed('thumbtime') addPositional('caption') return string.format('[[%s]]', table.concat(ret, '|')) end function p.main(frame) local origArgs = require('Module:Arguments').getArgs(frame, { wrappers = 'Template:File link' }) if not origArgs.file then error("[[Template:File link]]のエラー: 'file'引数が未入力です", 0) end -- Copy the arguments that were passed to a new table to avoid looking up -- every possible parameter in the frame object. local args = {} for k, v in pairs(origArgs) do -- Make _BLANK a special argument to add a blank parameter. For use in -- conditional templates etc. it is useful for blank arguments to be -- ignored, but we still need a way to specify them so that we can do -- things like [[File:Example.png|link=]]. if v == '_BLANK' then v = '' end args[k] = v end return p._main(args) end return p fadb7b1349eacd06b7ce6be9d990375fab67cfb0 モジュール:Effective protection level 828 25 63 62 2024-02-09T10:36:34Z Kyushujin 2 1版 をインポートしました Scribunto text/plain local p = {} -- Returns the permission required to perform a given action on a given title. -- If no title is specified, the title of the page being displayed is used. function p._main(action, pagename) local title if type(pagename) == 'table' and pagename.prefixedText then title = pagename elseif pagename then title = mw.title.new(pagename) else title = mw.title.getCurrentTitle() end pagename = title.prefixedText if action == 'autoreview' then local level = mw.ext.FlaggedRevs.getStabilitySettings(title) level = level and level.autoreview if level == 'review' then return 'reviewer' elseif level ~= '' then return level else return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review end elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then error( '第1引数にはedit、move、create、upload、undelete、autoreviewのどれかを指定してください', 2 ) end if title.namespace == 8 then -- MediaWiki namespace if title.text:sub(-3) == '.js' or title.text:sub(-4) == '.css' or title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page return 'interfaceadmin' else -- any non-JS/CSS MediaWiki page return 'sysop' end elseif title.namespace == 2 and title.isSubpage then if title.contentModel == 'javascript' or title.contentModel == 'css' then -- user JS or CSS page return 'interfaceadmin' elseif title.contentModel == 'json' then -- user JSON page return 'sysop' end end if action == 'undelete' then return 'eliminator' -- 英語版では'sysop' end local level = title.protectionLevels[action] and title.protectionLevels[action][1] if level == 'sysop' or level == 'editprotected' then return 'sysop' elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page return 'sysop' elseif level == 'templateeditor' then return 'templateeditor' elseif action == 'move' then local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move. if blacklistentry and not blacklistentry.params.autoconfirmed then return 'templateeditor' elseif title.namespace == 6 then return 'eliminator' -- 英語版では'filemover' elseif level == 'extendedconfirmed' then return 'extendedconfirmed' else return 'autoconfirmed' end end local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename) if blacklistentry then if not blacklistentry.params.autoconfirmed then return 'sysop' -- 英語版では'templateeditor' elseif level == 'extendedconfirmed' then return 'extendedconfirmed' else return 'autoconfirmed' end elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason return 'autoconfirmed' elseif level then return level elseif action == 'upload' then return 'autoconfirmed' -- 英語版とは異なり、日本語版では現在のところIPユーザーでも記事等を作成可能なので、以下はコメントアウト -- elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts -- return 'user' else return '*' end end setmetatable(p, { __index = function(t, k) return function(frame) return t._main(k, frame.args[1]) end end }) return p 366a310b678c4d083a5cec695cdc85050a07fb04 モジュール:Effective protection expiry 828 26 65 64 2024-02-09T10:36:35Z Kyushujin 2 1版 をインポートしました Scribunto text/plain local p = {} -- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known. -- If no title is specified, the title of the page being displayed is used. function p._main(action, pagename) local title if type(pagename) == 'table' and pagename.prefixedText then title = pagename elseif pagename then title = mw.title.new(pagename) else title = mw.title.getCurrentTitle() end pagename = title.prefixedText if action == 'autoreview' then local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title) return stabilitySettings and stabilitySettings.expiry or 'unknown' elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then error( '第1引数にはedit、move、create、upload、autoreviewのどれかを指定してください', 2 ) end local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename) if rawExpiry == 'infinity' then return 'infinity' elseif rawExpiry == '' then return 'unknown' else local year, month, day, hour, minute, second = rawExpiry:match( '^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$' ) if year then return string.format( '%s-%s-%sT%s:%s:%s', year, month, day, hour, minute, second ) else error('[[モジュール:Effective protection expiry]]のエラー; 有効期限のタイムスタンプの書式が不正です') end end end setmetatable(p, { __index = function(t, k) return function(frame) return t._main(k, frame.args[1]) end end }) return p bd6d5cdf7fc2a720603bcbc952773bb41197c42b モジュール:Protection banner/config 828 27 67 66 2024-02-09T10:36:35Z Kyushujin 2 1版 をインポートしました Scribunto text/plain -- This module provides configuration data for [[Module:Protection banner]]. return { -------------------------------------------------------------------------------- -- -- BANNER DATA -- -------------------------------------------------------------------------------- --[[ -- Banner data consists of six fields: -- * text - the main protection text that appears at the top of protection -- banners. -- * explanation - the text that appears below the main protection text, used -- to explain the details of the protection. -- * tooltip - the tooltip text you see when you move the mouse over a small -- padlock icon. -- * link - the page that the small padlock icon links to. -- * alt - the alt text for the small padlock icon. This is also used as tooltip -- text for the large protection banners. -- * image - the padlock image used in both protection banners and small padlock -- icons. -- -- The module checks in three separate tables to find a value for each field. -- First it checks the banners table, which has values specific to the reason -- for the page being protected. Then the module checks the defaultBanners -- table, which has values specific to each protection level. Finally, the -- module checks the masterBanner table, which holds data for protection -- templates to use if no data has been found in the previous two tables. -- -- The values in the banner data can take parameters. These are specified -- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name -- enclosed in curly braces). -- -- Available parameters: -- -- ${CURRENTVERSION} - a link to the page history or the move log, with the -- display message "current-version-edit-display" or -- "current-version-move-display". -- -- ${EDITREQUEST} - a link to create an edit request for the current page. -- -- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes -- on the talk page; you may submit a request to ask an administrator to make -- an edit if it is minor or supported by consensus." -- -- ${IMAGELINK} - a link to set the image to, depending on the protection -- action and protection level. -- -- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry -- is set. E.g. "Editing of this page by new or unregistered users is currently -- disabled until dd Month YYYY." -- -- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation -- so that it can be used in run-on sentences. -- -- ${PAGETYPE} - the type of the page, e.g. "article" or "template". -- Defined in the cfg.pagetypes table. -- -- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g. -- "Editing of this page by new or unregistered users is currently disabled" -- -- ${PROTECTIONDATE} - the protection date, if it has been supplied to the -- template. -- -- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or -- "semi-protected". -- -- ${PROTECTIONLOG} - a link to the protection log or the pending changes log, -- depending on the protection action. -- -- ${TALKPAGE} - a link to the talk page. If a section is specified, links -- straight to that talk page section. -- -- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to -- create a blurb like "This template is semi-protected", or "This article is -- move-protected until DD Month YYYY". -- -- ${VANDAL} - links for the specified username (or the root page name) -- using Module:Vandal-m. -- -- Functions -- -- For advanced users, it is possible to use Lua functions instead of strings -- in the banner config tables. Using functions gives flexibility that is not -- possible just by using parameters. Functions take two arguments, the -- protection object and the template arguments, and they must output a string. -- -- For example: -- -- text = function (protectionObj, args) -- if protectionObj.level == 'autoconfirmed' then -- return 'foo' -- else -- return 'bar' -- end -- end -- -- Some protection object properties and methods that may be useful: -- protectionObj.action - the protection action -- protectionObj.level - the protection level -- protectionObj.reason - the protection reason -- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set -- to indefinite, and the protection time in unix time if temporary. -- protectionObj.protectionDate - the protection date in unix time, or nil if -- unspecified. -- protectionObj.bannerConfig - the banner config found by the module. Beware -- of editing the config field used by the function, as it could create an -- infinite loop. -- protectionObj:isProtected - returns a boolean showing whether the page is -- protected. -- protectionObj:isTemporary - returns a boolean showing whether the expiry is -- temporary. -- protectionObj:isIncorrect - returns a boolean showing whether the protection -- template is incorrect. --]] -- The master banner data, used if no values have been found in banners or -- defaultBanners. masterBanner = { text = '${INTROBLURB}', explanation = '${EXPLANATIONBLURB}', tooltip = '${TOOLTIPBLURB}', link = '${IMAGELINK}', alt = '${PROTECTIONLEVEL}されたページ' }, -- The default banner data. This holds banner data for different protection -- levels. -- *required* - this table needs edit, move, autoreview and upload subtables. defaultBanners = { edit = {}, move = {}, autoreview = { default = { alt = 'Page protected with pending changes', tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users', image = 'Pending-protection-shackle.svg' } }, upload = {} }, -- The banner data. This holds banner data for different protection reasons. -- In fact, the reasons specified in this table control which reasons are -- valid inputs to the first positional parameter. -- -- There is also a non-standard "description" field that can be used for items -- in this table. This is a description of the protection reason for use in the -- module documentation. -- -- *required* - this table needs edit, move, autoreview and upload subtables. banners = { edit = { --blp = { -- description = 'For pages protected to promote compliance with the' -- .. ' [[Wikipedia:Biographies of living persons' -- .. '|biographies of living persons]] policy', -- text = '${INTROFRAGMENT} to promote compliance with' -- .. ' [[Wikipedia:Biographies of living persons' -- .. "|Wikipedia's&nbsp;policy on&nbsp;the&nbsp;biographies" -- .. ' of&nbsp;living&nbsp;people]].', -- tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on' -- .. ' biographies of living persons', --}, dmca = { description = '[[デジタルミレニアム著作権法]]に基づく削除要求があったため、' .. '保護されたページ', explanation = function (protectionObj, args) local ret = 'この${PAGETYPE}の内容に関して、[[デジタルミレニアム著作権法]]' .. '(DMCA)に基づく権利所有者への通知があったため、' .. 'ウィキメディア財団は問題となった個所を削除した上で、' .. 'このページの編集を制限しました。' if args.notice then ret = ret .. '財団が受理した通知のコピーは ' .. args.notice .. ' にあります。' end ret = ret .. '異議申し立て方法など詳細な情報については' .. '[[Wikipedia:事務局行動]]および${TALKPAGE}をご覧ください。<br />' .. "'''編集制限が解除されるまで、" .. "このお知らせを除去しないでください。'''" return ret end, image = 'Office-protection-shackle-WMFlogo.svg', }, dispute = { description = '[[Wikipedia:編集合戦|編集合戦]]により保護されたページ', text = '[[Wikipedia:編集合戦|編集合戦]]が発生したため、${INTROBLURB}', explanation = "${CURRENTVERSION}の内容が'''適切とは限りません'''。" .. '詳しくは[[Wikipedia:保護の方針|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '問題となった個所について意見がある場合は、' .. '${TALKPAGE}で議論するよう心がけてください。' .. '[[Wikipedia:合意形成|合意が形成]]され、保護を解除できる状態になった場合は' .. '[[Wikipedia:保護解除依頼|保護の解除を依頼]]してください。', tooltip = '編集合戦が発生したため、${TOOLTIPBLURB}', }, --ecp = { -- description = 'For articles in topic areas authorized by' -- .. ' [[Wikipedia:Arbitration Committee|ArbCom]] or' -- .. ' meets the criteria for community use', -- tooltip = 'This ${PAGETYPE} is extended-confirmed protected', -- alt = 'Extended-protected ${PAGETYPE}', --}, --mainpage = { -- description = 'For pages protected for being displayed on the [[Main Page]]', -- text = 'This file is currently' -- .. ' [[Wikipedia:This page is protected|protected]] from' -- .. ' editing because it is currently or will soon be displayed' -- .. ' on the [[Main Page]].', -- explanation = 'Images on the Main Page are protected due to their high' -- .. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.' -- .. '<br /><span style="font-size:90%;">' -- .. "'''Administrators:''' Once this image is definitely off the Main Page," -- .. ' please unprotect this file, or reduce to semi-protection,' -- .. ' as appropriate.</span>', --}, office = { description = '[[Wikipedia:事務局行動|事務局行動]]により保護されたページ', text = function (protectionObj, args) local ret = '現在この${PAGETYPE}は[[Wikipedia:事務局行動|' .. 'ウィキメディア財団事務局]]の監視下にあり、' if protectionObj.protectionDate then ret = ret .. '${PROTECTIONDATE}以降、' end return ret .. '保護されています。' end, explanation = "もしあなたがこのページを編集できたとしても、加筆・修正を行う前に" .. "${TALKPAGE}で議論するよう心がけてください。<br />" .. "'''ウィキメディア財団の許可があるまで、このページの保護を" .. "解除しないでください。'''", image = 'Office-protection-shackle-WMFlogo.svg', }, permanent = { description = '半永久的に保護されているページ', text = function (protectionObj, args) if protectionObj.level == 'sysop' then return 'この${PAGETYPE}は、半永久的に編集[[Wikipedia:保護|保護]]されています。' elseif protectionObj.level == 'extendedconfirmed' then return 'この${PAGETYPE}は、[[Wikipedia:利用者#拡張承認された利用者|' .. '拡張承認された利用者]]以外の編集を半永久的に[[Wikipedia:保護|禁止]]しています。' else return 'この${PAGETYPE}は、[[Wikipedia:利用者#新規利用者|新規利用者]]' .. 'および[[Wikipedia:利用者#IP利用者|未登録利用者]]からの編集を' .. '半永久的に[[Wikipedia:保護|禁止]]しています。' end end, explanation = function (protectionObj, args) if protectionObj.level == 'sysop' then return '詳しくは[[Wikipedia:保護の方針#半永久的な保護|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '変更が必要なときは${TALKPAGE}で議論し、[[Wikipedia:合意形成|合意形成]]後に' .. '[[Wikipedia:管理者伝言板/保護ページ編集|保護編集依頼]]を行ってください。' elseif protectionObj.level == 'extendedconfirmed' then return '詳しくは[[Wikipedia:拡張半保護の方針#半永久的な拡張半保護|拡張半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. 'この${PAGETYPE}を編集することができない場合、${TALKPAGE}にて' .. '<code class="nowrap">{{[[Template:拡張半保護編集依頼|拡張半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:拡張半保護の方針#拡張半保護されたページの編集|編集を依頼]]するか、' .. '[[Wikipedia:管理者伝言板/拡張承認の申請|拡張承認の申請]]をしてください。' else return '詳しくは[[Wikipedia:半保護の方針#半永久的な半保護|半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. 'この${PAGETYPE}を編集することができない場合、${TALKPAGE}にて' .. '<code class="nowrap">{{[[Template:半保護編集依頼|半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:半保護の方針#半保護されたページの編集|編集を依頼]]してください。' end end, tooltip = '半永久的に${PROTECTIONLEVEL}されている${PAGETYPE}', alt = '半永久的に${PROTECTIONLEVEL}されている${PAGETYPE}', image = function (protectionObj) if protectionObj.level == 'sysop' then return 'Edit Semi-permanent Protection.svg' elseif protectionObj.level == 'extendedconfirmed' then return 'Edit Semi-permanent Extended Semi-protection.svg' else return 'Edit Semi-permanent Semi-protection.svg' end end, }, reset = { description = '[[Wikipedia:事務局行動|事務局行動]]により、内容が' .. '縮小された上で保護されたページ', text = function (protectionObj, args) local ret = '現在この${PAGETYPE}は[[Wikipedia:事務局行動|' .. 'ウィキメディア財団事務局]]の監視下にあり、' if protectionObj.protectionDate then ret = ret .. '${PROTECTIONDATE}以降、' end return ret .. '保護されています。' end, explanation = 'この${PAGETYPE}には最小限の内容しかないため、' .. '[[WP:NPOV|中立的な観点]]や[[WP:V|検証可能性]]といった方針に' .. '適合する形で、全面的に改稿されることが望まれています。' .. "もしあなたがこのページを編集できたとしても、加筆・修正を行う前に" .. "${TALKPAGE}で議論するよう心がけてください。<br />" .. 'この${PAGETYPE}が保護される以前の版に書かれていた内容は' .. '復帰させないでください。' .. 'ノートページで議論を行う際も同様です。<br />' .. "'''ウィキメディア財団の許可があるまで、このページの保護を" .. "解除したり、このお知らせを除去しないでください。'''", image = 'Office-protection-shackle-WMFlogo.svg', }, --sock = { -- description = 'For pages protected due to' -- .. ' [[Wikipedia:Sock puppetry|sock puppetry]]', -- text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of' -- .. ' [[Wikipedia:Blocking policy|blocked]] or' -- .. ' [[Wikipedia:Banning policy|banned users]]' -- .. ' from editing it.', -- tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from' -- .. ' editing it', --}, template = { description = '[[Wikipedia:影響が特に大きいテンプレート|' .. '影響が特に大きいテンプレート・モジュール]]', text = 'この[[Wikipedia:影響が特に大きいテンプレート|' .. '影響が特に大きい${PAGETYPE}]]は、[[Wikipedia:荒らし|荒らし]]を予防するために' .. '${PROTECTIONLEVEL}されています。', explanation = function (protectionObj, args) if protectionObj.level == 'sysop' then return '詳しくは[[Wikipedia:保護の方針#半永久的な保護|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '変更が必要なときは${TALKPAGE}で議論し、[[Wikipedia:合意形成|合意形成]]後に' .. '[[Wikipedia:管理者伝言板/保護ページ編集|保護編集依頼]]を行ってください。' elseif protectionObj.level == 'extendedconfirmed' then return '詳しくは[[Wikipedia:拡張半保護の方針#半永久的な拡張半保護|拡張半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. 'この${PAGETYPE}を編集することができない場合、${TALKPAGE}にて' .. '<code class="nowrap">{{[[Template:拡張半保護編集依頼|拡張半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:拡張半保護の方針#拡張半保護されたページの編集|編集を依頼]]するか、' .. '[[Wikipedia:管理者伝言板/拡張承認の申請|拡張承認の申請]]をしてください。' else return '詳しくは[[Wikipedia:半保護の方針#半永久的な半保護|半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. 'この${PAGETYPE}を編集することができない場合、${TALKPAGE}にて' .. '<code class="nowrap">{{[[Template:半保護編集依頼|半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:半保護の方針#半保護されたページの編集|編集を依頼]]してください。' end end, tooltip = 'この影響が特に大きい${PAGETYPE}は、' .. '荒らしを予防するために${PROTECTIONLEVEL}されています。', alt = '半永久的に${PROTECTIONLEVEL}されている${PAGETYPE}', image = function (protectionObj) if protectionObj.level == 'sysop' then return 'Edit Semi-permanent Protection.svg' elseif protectionObj.level == 'extendedconfirmed' then return 'Edit Semi-permanent Extended Semi-protection.svg' else return 'Edit Semi-permanent Semi-protection.svg' end end, }, --usertalk = { -- description = 'For pages protected against disruptive edits by a' -- .. ' particular user', -- text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,' -- .. ' such as abusing the' -- .. ' &#123;&#123;[[Template:unblock|unblock]]&#125;&#125; template.', -- explanation = 'If you cannot edit this user talk page and you need to' -- .. ' make a change or leave a message, you can' -- .. ' [[Wikipedia:Requests for page protection' -- .. '#Current requests for edits to a protected page' -- .. '|request an edit]],' -- .. ' [[Wikipedia:Requests for page protection' -- .. '#Current requests for reduction in protection level' -- .. '|request unprotection]],' -- .. ' [[Special:Userlogin|log in]],' -- .. ' or [[Special:UserLogin/signup|create an account]].', --}, vandalism = { description = '[[Wikipedia:荒らし|荒らし]]行為により保護されたページ', text = '度重なる[[Wikipedia:荒らし|荒らし]]行為のため、${INTROBLURB}', tooltip = '度重なる荒らし行為のため、${TOOLTIPBLURB}' } }, move = { dispute = { description = '[[Wikipedia:編集合戦#移動合戦|移動合戦]]により保護されたページ', text = '[[Wikipedia:編集合戦#移動合戦|移動合戦]]が発生したため、${INTROFRAGMENT}', explanation = "${CURRENTVERSION}が'''適切とは限りません'''。" .. '詳しくは[[Wikipedia:保護の方針|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. 'ページ名について意見がある場合は${TALKPAGE}で議論し、' .. '必要に応じて[[Wikipedia:ページの改名]]に従い、' .. '[[Wikipedia:改名提案|改名の提案]]をしてください。' .. '[[Wikipedia:合意形成|合意が形成]]され、保護を解除できる状態になった場合は' .. '[[Wikipedia:保護解除依頼|保護の解除を依頼]]してください。', tooltip = '移動合戦が発生したため、${TOOLTIPBLURB}', }, vandalism = { description = '[[Wikipedia:荒らし#移動荒らし|移動荒らし]]行為により保護されたページ', text = '度重なる[[Wikipedia:荒らし#移動荒らし|移動荒らし]]行為のため、${INTROFRAGMENT}', tooltip = '度重なる移動荒らし行為のため、${TOOLTIPBLURB}' } }, autoreview = {}, upload = {} }, -------------------------------------------------------------------------------- -- -- GENERAL DATA TABLES -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Protection blurbs -------------------------------------------------------------------------------- -- This table produces the protection blurbs available with the -- ${PROTECTIONBLURB} parameter. It is sorted by protection action and -- protection level, and is checked by the module in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. protectionBlurbs = { edit = { default = 'この${PAGETYPE}は編集[[Wikipedia:保護|保護]]されています', autoconfirmed = 'この${PAGETYPE}は[[Wikipedia:利用者#新規利用者|新規利用者]]' .. 'および[[Wikipedia:利用者#IP利用者|未登録利用者]]からの編集を[[Wikipedia:保護|禁止]]しています', extendedconfirmed = 'この${PAGETYPE}は[[Wikipedia:利用者#拡張承認された利用者|' .. '拡張承認された利用者]]以外の編集を[[Wikipedia:保護|禁止]]しています', }, move = { default = 'この${PAGETYPE}は[[Help:ページの移動|移動]][[Wikipedia:保護|保護]]されています', extendedconfirmed = 'この${PAGETYPE}は[[Wikipedia:利用者#拡張承認された利用者|' .. '拡張承認された利用者]]以外の[[Help:ページの移動|移動]]を[[Wikipedia:保護|禁止]]しています', }, autoreview = { default = 'All edits made to this ${PAGETYPE} by' .. ' [[Wikipedia:User access levels#New users|new]] or' .. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]' .. ' users are currently' .. ' [[Wikipedia:Pending changes|subject to review]]' }, upload = { default = 'この${PAGETYPE}は[[Wikipedia:ファイルのアップロード|アップロード]]' .. '[[Wikipedia:保護|保護]]されています', extendedconfirmed = 'この${PAGETYPE}は[[Wikipedia:利用者#拡張承認された利用者|' .. '拡張承認された利用者]]以外の[[Wikipedia:ファイルのアップロード|アップロード]]を' .. '[[Wikipedia:保護|禁止]]しています', } }, -------------------------------------------------------------------------------- -- Explanation blurbs -------------------------------------------------------------------------------- -- This table produces the explanation blurbs available with the -- ${EXPLANATIONBLURB} parameter. It is sorted by protection action, -- protection level, and whether the page is a talk page or not. If the page is -- a talk page it will have a talk key of "talk"; otherwise it will have a talk -- key of "subject". The table is checked in the following order: -- 1. page's protection action, page's protection level, page's talk key -- 2. page's protection action, page's protection level, default talk key -- 3. page's protection action, default protection level, page's talk key -- 4. page's protection action, default protection level, default talk key -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. explanationBlurbs = { edit = { autoconfirmed = { subject = '詳しくは[[Wikipedia:半保護の方針|半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。この${PAGETYPE}を編集することができない場合、${TALKPAGE}' .. 'にて<code class="nowrap">{{[[Template:半保護編集依頼|半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:半保護の方針#半保護されたページの編集|編集を依頼]]してください。' .. '半保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|半保護の解除を依頼]]してください。', default = '詳しくは[[Wikipedia:半保護の方針|半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '半保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|半保護の解除を依頼]]してください。', }, extendedconfirmed = { subject = '詳しくは[[Wikipedia:拡張半保護の方針|拡張半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。この${PAGETYPE}を編集することができない場合、${TALKPAGE}' .. 'にて<code class="nowrap">{{[[Template:拡張半保護編集依頼|拡張半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:拡張半保護の方針#拡張半保護されたページの編集|編集を依頼]]するか、' .. '[[Wikipedia:管理者伝言板/拡張承認の申請|拡張承認の申請]]を' .. 'してください。拡張半保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|拡張半保護の解除を依頼]]してください。', default = '詳しくは[[Wikipedia:拡張半保護の方針|拡張半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '拡張半保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|拡張半保護の解除を依頼]]してください。' }, default = { subject = '詳しくは[[Wikipedia:保護の方針|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '変更が必要なときは${TALKPAGE}で議論し、[[Wikipedia:合意形成|合意形成]]後に' .. '[[Wikipedia:管理者伝言板/保護ページ編集|保護編集依頼]]を行ってください。' .. '合意が形成されるなど、保護を解除できる状態になった場合は' .. '[[Wikipedia:保護解除依頼|保護の解除を依頼]]してください。', default = '詳しくは[[Wikipedia:保護の方針|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '合意が形成されるなど、保護を解除できる状態になった場合は' .. '[[Wikipedia:保護解除依頼|保護の解除を依頼]]してください。' } }, move = { extendedconfirmed = { subject = '詳しくは[[Wikipedia:拡張半保護の方針|拡張半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. 'ページを移動できない場合は、${TALKPAGE}にて' .. '<code class="nowrap">{{[[Template:拡張半保護編集依頼|拡張半保護編集依頼]]}}</code>' .. 'を用いて[[Wikipedia:拡張半保護の方針#拡張半保護されたページの編集|移動を依頼]]するか、' .. '[[Wikipedia:管理者伝言板/拡張承認の申請|拡張承認の申請]]を' .. 'してください。移動拡張半保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|移動拡張半保護の解除を依頼]]してください。', default = '詳しくは[[Wikipedia:拡張半保護の方針|拡張半保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '移動拡張半保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|移動拡張半保護の解除を依頼]]してください。' }, default = { subject = '詳しくは[[Wikipedia:保護の方針|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '移動が必要なときは${TALKPAGE}で議論し、' .. '[[Wikipedia:合意形成|合意形成]]後に' .. '[[Wikipedia:移動依頼|移動依頼]]で依頼してください。' .. '合意が形成されるなど、移動保護を解除できる状態になった場合は' .. '[[Wikipedia:保護解除依頼|移動保護の解除を依頼]]してください。', default = '詳しくは[[Wikipedia:保護の方針|保護の方針]]および' .. '${PROTECTIONLOG}をご覧ください。' .. '合意が形成されるなど、移動保護を解除できる状態になった場合は' .. '[[Wikipedia:保護解除依頼|移動保護の解除を依頼]]してください。' } }, autoreview = { default = { default = 'See the [[Wikipedia:Protection policy|' .. 'protection policy]] and ${PROTECTIONLOG} for more details.' .. ' Edits to this ${PAGETYPE} by new and unregistered users' .. ' will not be visible to readers until they are accepted by' .. ' a reviewer. To avoid the need for your edits to be' .. ' reviewed, you may' .. ' [[Wikipedia:Requests for page protection' .. '#Current requests for reduction in protection level' .. '|request unprotection]], [[Special:Userlogin|log in]], or' .. ' [[Special:UserLogin/signup|create an account]].' }, }, upload = { default = { default = '詳しくは${PROTECTIONLOG}をご覧ください。' .. '編集保護されていない場合は、' .. 'ファイルの説明を編集することができます。' .. 'アップロード保護を解除しても問題ない状態になった場合、' .. '[[Wikipedia:保護解除依頼|アップロード保護の解除を依頼]]してください。' } } }, -------------------------------------------------------------------------------- -- Protection levels -------------------------------------------------------------------------------- -- This table provides the data for the ${PROTECTIONLEVEL} parameter, which -- produces a short label for different protection levels. It is sorted by -- protection action and protection level, and is checked in the following -- order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. protectionLevels = { edit = { default = '保護', templateeditor = 'template-protected', extendedconfirmed = '拡張半保護', autoconfirmed = '半保護', }, move = { default = '移動保護', extendedconfirmed = '移動拡張半保護' }, autoreview = { }, upload = { default = 'アップロード保護', extendedconfirmed = 'アップロード拡張半保護' } }, -------------------------------------------------------------------------------- -- Images -------------------------------------------------------------------------------- -- This table lists different padlock images for each protection action and -- protection level. It is used if an image is not specified in any of the -- banner data tables, and if the page does not satisfy the conditions for using -- the ['image-filename-indef'] image. It is checked in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level images = { edit = { default = 'Edit Protection.svg', templateeditor = 'Template-protection-shackle.svg', extendedconfirmed = 'Edit Extended Semi-protection.svg', autoconfirmed = 'Edit Semi-protection.svg' }, move = { default = 'Move-protection-shackle.svg', extendedconfirmed = 'Move Extended Semi-protection.svg', }, autoreview = { default = 'Pending-protection-shackle.svg' }, upload = { default = 'Upload Protection.svg', extendedconfirmed = 'Upload Extended Semi-protection.svg', } }, -- Pages with a reason specified in this table will show the special "indef" -- padlock, defined in the 'image-filename-indef' message, if no expiry is set. indefImageReasons = { template = true }, -------------------------------------------------------------------------------- -- Image links -------------------------------------------------------------------------------- -- This table provides the data for the ${IMAGELINK} parameter, which gets -- the image link for small padlock icons based on the page's protection action -- and protection level. It is checked in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. imageLinks = { edit = { default = 'Wikipedia:保護の方針', templateeditor = 'Wikipedia:Protection policy#template', extendedconfirmed = 'Wikipedia:拡張半保護の方針', autoconfirmed = 'Wikipedia:半保護の方針' }, move = { default = 'Wikipedia:保護の方針', extendedconfirmed = 'Wikipedia:拡張半保護の方針' }, autoreview = { default = 'Wikipedia:Protection policy#pending' }, upload = { default = '' } }, -------------------------------------------------------------------------------- -- Padlock indicator names -------------------------------------------------------------------------------- -- This table provides the "name" attribute for the <indicator> extension tag -- with which small padlock icons are generated. All indicator tags on a page -- are displayed in alphabetical order based on this attribute, and with -- indicator tags with duplicate names, the last tag on the page wins. -- The attribute is chosen based on the protection action; table keys must be a -- protection action name or the string "default". padlockIndicatorNames = { move = 'pp-move', autoreview = 'pp-autoreview', upload = 'pp-upload', default = 'pp-default' }, -------------------------------------------------------------------------------- -- Protection categories -------------------------------------------------------------------------------- --[[ -- The protection categories are stored in the protectionCategories table. -- Keys to this table are made up of the following strings: -- -- 1. the expiry date -- 2. the namespace -- 3. the protection reason (e.g. "dispute" or "vandalism") -- 4. the protection level (e.g. "sysop" or "autoconfirmed") -- 5. the action (e.g. "edit" or "move") -- -- When the module looks up a category in the table, first it will will check to -- see a key exists that corresponds to all five parameters. For example, a -- user page semi-protected from vandalism for two weeks would have the key -- "temp-user-vandalism-autoconfirmed-edit". If no match is found, the module -- changes the first part of the key to "all" and checks the table again. It -- keeps checking increasingly generic key combinations until it finds the -- field, or until it reaches the key "all-all-all-all-all". -- -- The module uses a binary matrix to determine the order in which to search. -- This is best demonstrated by a table. In this table, the "0" values -- represent "all", and the "1" values represent the original data (e.g. -- "indef" or "file" or "vandalism"). -- -- expiry namespace reason level action -- order -- 1 1 1 1 1 1 -- 2 0 1 1 1 1 -- 3 1 0 1 1 1 -- 4 0 0 1 1 1 -- 5 1 1 0 1 1 -- 6 0 1 0 1 1 -- 7 1 0 0 1 1 -- 8 0 0 0 1 1 -- 9 1 1 1 0 1 -- 10 0 1 1 0 1 -- 11 1 0 1 0 1 -- 12 0 0 1 0 1 -- 13 1 1 0 0 1 -- 14 0 1 0 0 1 -- 15 1 0 0 0 1 -- 16 0 0 0 0 1 -- 17 1 1 1 1 0 -- 18 0 1 1 1 0 -- 19 1 0 1 1 0 -- 20 0 0 1 1 0 -- 21 1 1 0 1 0 -- 22 0 1 0 1 0 -- 23 1 0 0 1 0 -- 24 0 0 0 1 0 -- 25 1 1 1 0 0 -- 26 0 1 1 0 0 -- 27 1 0 1 0 0 -- 28 0 0 1 0 0 -- 29 1 1 0 0 0 -- 30 0 1 0 0 0 -- 31 1 0 0 0 0 -- 32 0 0 0 0 0 -- -- In this scheme the action has the highest priority, as it is the last -- to change, and the expiry has the least priority, as it changes the most. -- The priorities of the expiry, the protection level and the action are -- fixed, but the priorities of the reason and the namespace can be swapped -- through the use of the cfg.bannerDataNamespaceHasPriority table. --]] -- If the reason specified to the template is listed in this table, -- namespace data will take priority over reason data in the protectionCategories -- table. reasonsWithNamespacePriority = { vandalism = true, }, -- The string to use as a namespace key for the protectionCategories table for each -- namespace number. categoryNamespaceKeys = { [ 2] = 'user', [ 3] = 'user', [ 4] = 'project', [ 6] = 'file', [ 8] = 'mediawiki', [ 10] = 'template', [ 12] = 'project', [ 14] = 'category', [100] = 'portal', [828] = 'module', }, protectionCategories = { ['all|all|all|all|all'] = '編集保護中のページ', --['all|all|office|all|all'] = 'Wikipedia Office-protected pages', --['all|all|reset|all|all'] = 'Wikipedia Office-protected pages', --['all|all|dmca|all|all'] = 'Wikipedia Office-protected pages', ['all|all|permanent|all|all'] = '保護運用中のページ', --['all|all|mainpage|all|all'] = 'Wikipedia fully-protected main page files', --['all|all|ecp|extendedconfirmed|all'] = '編集拡張半保護中のページ', ['all|all|all|extendedconfirmed|edit'] = '編集拡張半保護中のページ', ['all|all|all|autoconfirmed|edit'] = '編集半保護中のページ', --['indef|all|all|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected pages', --['all|all|blp|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected biographies of living people', --['temp|all|blp|autoconfirmed|edit'] = 'Wikipedia temporarily semi-protected biographies of living people', --['all|all|dispute|autoconfirmed|edit'] = 'Wikipedia pages semi-protected due to dispute', --['all|all|sock|autoconfirmed|edit'] = 'Wikipedia pages semi-protected from banned users', --['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism', --['all|category|all|autoconfirmed|edit'] = 'Wikipedia semi-protected categories', --['all|file|all|autoconfirmed|edit'] = 'Wikipedia semi-protected files', --['all|portal|all|autoconfirmed|edit'] = 'Wikipedia semi-protected portals', --['all|project|all|autoconfirmed|edit'] = 'Wikipedia semi-protected project pages', --['all|talk|all|autoconfirmed|edit'] = 'Wikipedia semi-protected talk pages', ['all|template|all|sysop|edit'] = '編集保護中のテンプレート', ['all|template|all|autoconfirmed|edit'] = '編集半保護中のテンプレート', --['all|user|all|autoconfirmed|edit'] = 'Wikipedia semi-protected user and user talk pages', --['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates', --['all|all|blp|sysop|edit'] = 'Wikipedia indefinitely protected biographies of living people', --['temp|all|blp|sysop|edit'] = 'Wikipedia temporarily protected biographies of living people', --['all|all|dispute|sysop|edit'] = 'Wikipedia pages protected due to dispute', --['all|all|sock|sysop|edit'] = 'Wikipedia pages protected from banned users', --['all|all|vandalism|sysop|edit'] = 'Wikipedia pages protected against vandalism', --['all|category|all|sysop|edit'] = 'Wikipedia fully protected categories', --['all|file|all|sysop|edit'] = 'Wikipedia fully-protected files', --['all|project|all|sysop|edit'] = 'Wikipedia fully-protected project pages', --['all|talk|all|sysop|edit'] = 'Wikipedia fully-protected talk pages', --['all|user|all|sysop|edit'] = 'Wikipedia fully protected user and user talk pages', ['all|module|all|sysop|edit'] = '編集保護中のモジュール', --['all|module|all|templateeditor|edit'] = 'Wikipedia template-protected modules', ['all|module|all|autoconfirmed|edit'] = '編集半保護中のモジュール', ['all|all|all|sysop|move'] = '移動保護中のページ', ['all|all|all|extendedconfirmed|move'] = '移動拡張半保護中のページ', --['indef|all|all|sysop|move'] = 'Wikipedia indefinitely move-protected pages', --['all|all|dispute|sysop|move'] = 'Wikipedia pages move-protected due to dispute', --['all|all|vandalism|sysop|move'] = 'Wikipedia pages move-protected due to vandalism', --['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals', --['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals', --['all|project|all|sysop|move'] = 'Wikipedia move-protected project pages', --['all|talk|all|sysop|move'] = 'Wikipedia move-protected talk pages', ['all|template|all|sysop|move'] = '移動保護中のテンプレート', --['all|user|all|sysop|move'] = 'Wikipedia move-protected user and user talk pages', --['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages', ['all|file|all|all|upload'] = 'アップロード保護中のファイル', ['all|file|all|extendedconfirmed|upload']= 'アップロード拡張半保護中のファイル', }, -------------------------------------------------------------------------------- -- Expiry category config -------------------------------------------------------------------------------- -- This table configures the expiry category behaviour for each protection -- action. -- * If set to true, setting that action will always categorise the page if -- an expiry parameter is not set. -- * If set to false, setting that action will never categorise the page. -- * If set to nil, the module will categorise the page if: -- 1) an expiry parameter is not set, and -- 2) a reason is provided, and -- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck -- table. expiryCheckActions = { edit = nil, move = false, autoreview = true, upload = false }, reasonsWithoutExpiryCheck = { blp = true, template = true, }, -------------------------------------------------------------------------------- -- Pagetypes -------------------------------------------------------------------------------- -- This table produces the page types available with the ${PAGETYPE} parameter. -- Keys are namespace numbers, or the string "default" for the default value. pagetypes = { -- [0] = '記事', [6] = 'ファイル', [10] = 'テンプレート', [14] = 'カテゴリ', [828] = 'モジュール', [1] = 'ノートページ', [3] = '会話ページ', [5] = 'ノートページ', [7] = 'ノートページ', [9] = 'ノートページ', [11] = 'ノートページ', [13] = 'ノートページ', [15] = 'ノートページ', [101] = 'ノートページ', [103] = 'ノートページ', [829] = 'ノートページ', [2301] = 'ノートページ', [2303] = 'ノートページ', default = 'ページ' }, -------------------------------------------------------------------------------- -- Strings marking indefinite protection -------------------------------------------------------------------------------- -- This table contains values passed to the expiry parameter that mean the page -- is protected indefinitely. indefStrings = { ['indef'] = true, ['indefinite'] = true, ['indefinitely'] = true, ['infinite'] = true, }, -------------------------------------------------------------------------------- -- Group hierarchy -------------------------------------------------------------------------------- -- This table maps each group to all groups that have a superset of the original -- group's page editing permissions. hierarchy = { sysop = {}, eliminator = {'sysop'}, reviewer = {'sysop'}, filemover = {'sysop'}, templateeditor = {'sysop'}, extendedconfirmed = {'sysop'}, autoconfirmed = {'eliminator', 'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'}, user = {'autoconfirmed'}, ['*'] = {'user'} }, -------------------------------------------------------------------------------- -- Wrapper templates and their default arguments -------------------------------------------------------------------------------- -- This table contains wrapper templates used with the module, and their -- default arguments. Templates specified in this table should contain the -- following invocation, and no other template content: -- -- {{#invoke:Protection banner|main}} -- -- If other content is desired, it can be added between -- <noinclude>...</noinclude> tags. -- -- When a user calls one of these wrapper templates, they will use the -- default arguments automatically. However, users can override any of the -- arguments. wrappers = { ['Template:Pp'] = {}, ['Template:Pp-extended'] = {'ecp'}, ['Template:Pp-blp'] = {'blp'}, -- we don't need Template:Pp-create ['Template:Pp-dispute'] = {'dispute'}, ['Template:Pp-main-page'] = {'mainpage'}, ['Template:Pp-move'] = {action = 'move'}, ['Template:Pp-move-dispute'] = {'dispute', action = 'move'}, -- we don't need Template:Pp-move-indef ['Template:Pp-move-vandalism'] = {'vandalism', action = 'move'}, ['Template:Pp-office'] = {'office'}, ['Template:Pp-office-dmca'] = {'dmca'}, ['Template:Pp-pc'] = {action = 'autoreview', small = true}, ['Template:Pp-pc1'] = {action = 'autoreview', small = true}, ['Template:保護運用'] = {'permanent', small = true}, ['Template:Pp-reset'] = {'reset'}, ['Template:Pp-semi-indef'] = {small = true}, ['Template:Pp-sock'] = {'sock'}, ['Template:Pp-template'] = {'template', small = true}, ['Template:Pp-upload'] = {action = 'upload'}, ['Template:Pp-usertalk'] = {'usertalk'}, ['Template:Pp-vandalism'] = {'vandalism'}, }, -------------------------------------------------------------------------------- -- -- MESSAGES -- -------------------------------------------------------------------------------- msg = { -------------------------------------------------------------------------------- -- Intro blurb and intro fragment -------------------------------------------------------------------------------- -- These messages specify what is produced by the ${INTROBLURB} and -- ${INTROFRAGMENT} parameters. If the protection is temporary they use the -- intro-blurb-expiry or intro-fragment-expiry, and if not they use -- intro-blurb-noexpiry or intro-fragment-noexpiry. -- It is possible to use banner parameters in these messages. ['intro-blurb-expiry'] = '${PROTECTIONBLURB}(${EXPIRY}まで)。', ['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}。', ['intro-fragment-expiry'] = '${PROTECTIONBLURB}(${EXPIRY}まで)。', ['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}。', -------------------------------------------------------------------------------- -- Tooltip blurb -------------------------------------------------------------------------------- -- These messages specify what is produced by the ${TOOLTIPBLURB} parameter. -- If the protection is temporary the tooltip-blurb-expiry message is used, and -- if not the tooltip-blurb-noexpiry message is used. -- It is possible to use banner parameters in these messages. ['tooltip-blurb-expiry'] = 'この${PAGETYPE}は${EXPIRY}まで${PROTECTIONLEVEL}されています。', ['tooltip-blurb-noexpiry'] = 'この${PAGETYPE}は${PROTECTIONLEVEL}されています。', ['tooltip-fragment-expiry'] = 'この${PAGETYPE}は${EXPIRY}まで${PROTECTIONLEVEL}されており、', ['tooltip-fragment-noexpiry'] = 'この${PAGETYPE}は${PROTECTIONLEVEL}されており、', -------------------------------------------------------------------------------- -- Special explanation blurb -------------------------------------------------------------------------------- -- An explanation blurb for pages that cannot be unprotected, e.g. for pages -- in the MediaWiki namespace. -- It is possible to use banner parameters in this message. ['explanation-blurb-nounprotect'] = 'See the [[Wikipedia:Protection policy|' .. 'protection policy]] and ${PROTECTIONLOG} for more details.' .. ' Please discuss any changes on the ${TALKPAGE}; you' .. ' may ${EDITREQUEST} to ask an' .. ' [[Wikipedia:Administrators|administrator]] to make an edit if it' .. ' is [[Help:Minor edit#When to mark an edit as a minor edit' .. '|uncontroversial]] or supported by [[Wikipedia:Consensus' .. '|consensus]].', -------------------------------------------------------------------------------- -- Protection log display values -------------------------------------------------------------------------------- -- These messages determine the display values for the protection log link -- or the pending changes log link produced by the ${PROTECTIONLOG} parameter. -- It is possible to use banner parameters in these messages. ['protection-log-display'] = '保護記録', ['pc-log-display'] = 'pending changes log', -------------------------------------------------------------------------------- -- Current version display values -------------------------------------------------------------------------------- -- These messages determine the display values for the page history link -- or the move log link produced by the ${CURRENTVERSION} parameter. -- It is possible to use banner parameters in these messages. ['current-version-move-display'] = '現在のページ名', ['current-version-edit-display'] = '現行版', -------------------------------------------------------------------------------- -- Talk page -------------------------------------------------------------------------------- -- This message determines the display value of the talk page link produced -- with the ${TALKPAGE} parameter. -- It is possible to use banner parameters in this message. ['talk-page-link-display'] = 'ノートページ', -------------------------------------------------------------------------------- -- Edit requests -------------------------------------------------------------------------------- -- This message determines the display value of the edit request link produced -- with the ${EDITREQUEST} parameter. -- It is possible to use banner parameters in this message. ['edit-request-display'] = 'submit an edit request', -------------------------------------------------------------------------------- -- Expiry date format -------------------------------------------------------------------------------- -- This is the format for the blurb expiry date. It should be valid input for -- the first parameter of the #time parser function. ['expiry-date-format'] = 'Y年Fj日" ("D") "H:i" ("e")"', -------------------------------------------------------------------------------- -- Tracking categories -------------------------------------------------------------------------------- -- These messages determine which tracking categories the module outputs. ['tracking-category-incorrect'] = '不適切な保護テンプレートのあるページ', ['tracking-category-mismatch'] = '保護理由と保護レベルが合致していないページ', -- 日本語版独自 ['tracking-category-template'] = 'Wikipedia template-protected pages other than templates and modules', -------------------------------------------------------------------------------- -- Images -------------------------------------------------------------------------------- -- These are images that are not defined by their protection action and protection level. ['image-filename-indef'] = 'Edit Protection.svg', ['image-filename-default'] = 'Transparent.gif', -------------------------------------------------------------------------------- -- End messages -------------------------------------------------------------------------------- } -------------------------------------------------------------------------------- -- End configuration -------------------------------------------------------------------------------- } d41b2a922176ff7bd4a5ed1b50ebde1185081c95 テンプレート:Rellink 10 28 69 68 2024-02-09T10:36:35Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <div class="rellink {{{extraclasses|}}}" style="margin-bottom: 0.5em; padding-left: 2em; font-style: italic;">{{{1}}}</div><noinclude> {{documentation}} </noinclude> bfed577a8fc6f9d931dd67a7dc16a3a9c940a514 テンプレート:Ombox 10 29 71 70 2024-02-09T10:36:36Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{#invoke:Message box|ombox}}<noinclude> {{documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> c5769da6f1f152b10c526fbcbf3941106a0b552b テンプレート:Sandbox other 10 30 73 72 2024-02-09T10:36:36Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{#if:{{#ifeq:{{#invoke:String|sublength|s={{SUBPAGENAME}}|i=0|len=7}}|sandbox|1}}{{#ifeq:{{SUBPAGENAME}}|doc|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}<!-- --><noinclude> {{Documentation}} </noinclude> 5e237028231c8eddac6dd278289ec8de1b654916 テンプレート:Clear 10 31 75 74 2024-02-09T10:36:37Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <div style="clear:{{{1|both}}};"></div><noinclude> {{documentation}} </noinclude> 38bab3e3d7fbd3d6800d46556e60bc6bac494d72 テンプレート:Documentation 10 32 77 76 2024-02-09T10:36:37Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude> <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> 913c721b3fb5da9e7d6bc410eb2ce87c99df6b03 モジュール:Documentation 828 33 79 78 2024-02-09T10:36:38Z Kyushujin 2 1版 をインポートしました Scribunto text/plain -- This module implements {{documentation}}. -- Get required modules. local getArgs = require('Module:Arguments').getArgs local messageBox = require('Module:Message box') -- Get the config table. local cfg = mw.loadData('Module:Documentation/config') local p = {} -- Often-used functions. local ugsub = mw.ustring.gsub ---------------------------------------------------------------------------- -- Helper functions -- -- These are defined as local functions, but are made available in the p -- table for testing purposes. ---------------------------------------------------------------------------- local function message(cfgKey, valArray, expectType) --[[ -- Gets a message from the cfg table and formats it if appropriate. -- The function raises an error if the value from the cfg table is not -- of the type expectType. The default type for expectType is 'string'. -- If the table valArray is present, strings such as $1, $2 etc. in the -- message are substituted with values from the table keys [1], [2] etc. -- For example, if the message "foo-message" had the value 'Foo $2 bar $1.', -- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz." --]] local msg = cfg[cfgKey] expectType = expectType or 'string' if type(msg) ~= expectType then error('メッセージ: cfg.' .. cfgKey .. 'の入力エラー。(想定:' .. expectType .. '、実際:' .. type(msg) .. ')', 2) end if not valArray then return msg end local function getMessageVal(match) match = tonumber(match) return valArray[match] or error('メッセージ: メッセージ設定で$' .. match .. 'キーの値が見つかりませんでした。' .. cfgKey, 4) end return ugsub(msg, '$([1-9][0-9]*)', getMessageVal) end p.message = message local function makeWikilink(page, display) if display then return mw.ustring.format('[[%s|%s]]', page, display) else return mw.ustring.format('[[%s]]', page) end end p.makeWikilink = makeWikilink local function makeCategoryLink(cat, sort) local catns = mw.site.namespaces[14].name return makeWikilink(catns .. ':' .. cat, sort) end p.makeCategoryLink = makeCategoryLink local function makeUrlLink(url, display) return mw.ustring.format('[%s %s]', url, display) end p.makeUrlLink = makeUrlLink local function makeToolbar(...) local ret = {} local lim = select('#', ...) if lim < 1 then return nil end for i = 1, lim do ret[#ret + 1] = select(i, ...) end -- 'documentation-toolbar' return '<span class="' .. message('toolbar-class') .. '">(' .. table.concat(ret, ' &#124; ') .. ')</span>' end p.makeToolbar = makeToolbar ---------------------------------------------------------------------------- -- Argument processing ---------------------------------------------------------------------------- local function makeInvokeFunc(funcName) return function (frame) local args = getArgs(frame, { valueFunc = function (key, value) if type(value) == 'string' then value = value:match('^%s*(.-)%s*$') -- Remove whitespace. if key == 'heading' or value ~= '' then return value else return nil end else return value end end }) return p[funcName](args) end end ---------------------------------------------------------------------------- -- Entry points ---------------------------------------------------------------------------- function p.nonexistent(frame) if mw.title.getCurrentTitle().subpageText == 'testcases' then return frame:expandTemplate{title = 'module test cases notice'} else return p.main(frame) end end p.main = makeInvokeFunc('_main') function p._main(args) --[[ -- This function defines logic flow for the module. -- @args - table of arguments passed by the user --]] local env = p.getEnvironment(args) local root = mw.html.create() root :wikitext(p._getModuleWikitext(args, env)) :wikitext(p.protectionTemplate(env)) :wikitext(p.sandboxNotice(args, env)) :tag('div') -- 'documentation-container' :addClass(message('container')) :newline() :tag('div') -- 'documentation' :addClass(message('main-div-classes')) :newline() :wikitext(p._startBox(args, env)) :wikitext(p._content(args, env)) :tag('div') -- 'documentation-clear' :addClass(message('clear')) :done() :newline() :done() :wikitext(p._endBox(args, env)) :done() :wikitext(p.addTrackingCategories(env)) -- 'Module:Documentation/styles.css' return mw.getCurrentFrame():extensionTag ( 'templatestyles', '', {src=cfg['templatestyles'] }) .. tostring(root) end ---------------------------------------------------------------------------- -- Environment settings ---------------------------------------------------------------------------- function p.getEnvironment(args) --[[ -- Returns a table with information about the environment, including title -- objects and other namespace- or path-related data. -- @args - table of arguments passed by the user -- -- Title objects include: -- env.title - the page we are making documentation for (usually the current title) -- env.templateTitle - the template (or module, file, etc.) -- env.docTitle - the /doc subpage. -- env.sandboxTitle - the /sandbox subpage. -- env.testcasesTitle - the /testcases subpage. -- env.printTitle - the print version of the template, located at the /Print subpage. -- -- Data includes: -- env.protectionLevels - the protection levels table of the title object. -- env.subjectSpace - the number of the title's subject namespace. -- env.docSpace - the number of the namespace the title puts its documentation in. -- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace. -- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template. -- -- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value -- returned will be nil. --]] local env, envFuncs = {}, {} -- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value -- returned by that function is memoized in the env table so that we don't call any of the functions -- more than once. (Nils won't be memoized.) setmetatable(env, { __index = function (t, key) local envFunc = envFuncs[key] if envFunc then local success, val = pcall(envFunc) if success then env[key] = val -- Memoise the value. return val end end return nil end }) function envFuncs.title() -- The title object for the current page, or a test page passed with args.page. local title local titleArg = args.page if titleArg then title = mw.title.new(titleArg) else title = mw.title.getCurrentTitle() end return title end function envFuncs.templateTitle() --[[ -- The template (or module, etc.) title object. -- Messages: -- 'sandbox-subpage' --> 'sandbox' -- 'testcases-subpage' --> 'testcases' --]] local subjectSpace = env.subjectSpace local title = env.title local subpage = title.subpageText if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then return mw.title.makeTitle(subjectSpace, title.baseText) else return mw.title.makeTitle(subjectSpace, title.text) end end function envFuncs.docTitle() --[[ -- Title object of the /doc subpage. -- Messages: -- 'doc-subpage' --> 'doc' --]] local title = env.title local docname = args[1] -- User-specified doc page. local docpage if docname then docpage = docname else docpage = env.docpageBase .. '/' .. message('doc-subpage') end return mw.title.new(docpage) end function envFuncs.sandboxTitle() --[[ -- Title object for the /sandbox subpage. -- Messages: -- 'sandbox-subpage' --> 'sandbox' --]] return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage')) end function envFuncs.testcasesTitle() --[[ -- Title object for the /testcases subpage. -- Messages: -- 'testcases-subpage' --> 'testcases' --]] return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage')) end function envFuncs.printTitle() --[[ -- Title object for the /Print subpage. -- Messages: -- 'print-subpage' --> 'Print' --]] return env.templateTitle:subPageTitle(message('print-subpage')) end function envFuncs.protectionLevels() -- The protection levels table of the title object. return env.title.protectionLevels end function envFuncs.subjectSpace() -- The subject namespace number. return mw.site.namespaces[env.title.namespace].subject.id end function envFuncs.docSpace() -- The documentation namespace number. For most namespaces this is the -- same as the subject namespace. However, pages in the Article, File, -- MediaWiki or Category namespaces must have their /doc, /sandbox and -- /testcases pages in talk space. local subjectSpace = env.subjectSpace if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then return subjectSpace + 1 else return subjectSpace end end function envFuncs.docpageBase() -- The base page of the /doc, /sandbox, and /testcases subpages. -- For some namespaces this is the talk page, rather than the template page. local templateTitle = env.templateTitle local docSpace = env.docSpace local docSpaceText = mw.site.namespaces[docSpace].name -- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon. return docSpaceText .. ':' .. templateTitle.text end function envFuncs.compareUrl() -- Diff link between the sandbox and the main template using [[Special:ComparePages]]. local templateTitle = env.templateTitle local sandboxTitle = env.sandboxTitle if templateTitle.exists and sandboxTitle.exists then local compareUrl = mw.uri.fullUrl( 'Special:ComparePages', { page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText} ) return tostring(compareUrl) else return nil end end return env end ---------------------------------------------------------------------------- -- Auxiliary templates ---------------------------------------------------------------------------- p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext') function p._getModuleWikitext(args, env) local currentTitle = mw.title.getCurrentTitle() if currentTitle.contentModel ~= 'Scribunto' then return end pcall(require, currentTitle.prefixedText) -- if it fails, we don't care local moduleWikitext = package.loaded["Module:Module wikitext"] if moduleWikitext then return moduleWikitext.main() end end function p.sandboxNotice(args, env) --[=[ -- Generates a sandbox notice for display above sandbox pages. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]' -- 'sandbox-notice-blurb' --> 'This is the $1 for $2.' -- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).' -- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page' -- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page' -- 'sandbox-notice-pagetype-other' --> 'sandbox page' -- 'sandbox-notice-compare-link-display' --> 'diff' -- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.' -- 'sandbox-notice-testcases-link-display' --> 'test cases' -- 'sandbox-category' --> 'Template sandboxes' --]=] local title = env.title local sandboxTitle = env.sandboxTitle local templateTitle = env.templateTitle local subjectSpace = env.subjectSpace if not (subjectSpace and title and sandboxTitle and templateTitle and mw.title.equals(title, sandboxTitle)) then return nil end -- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text". local omargs = {} omargs.image = message('sandbox-notice-image') -- Get the text. We start with the opening blurb, which is something like -- "This is the template sandbox for [[Template:Foo]] (diff)." local text = '' local pagetype if subjectSpace == 10 then pagetype = message('sandbox-notice-pagetype-template') elseif subjectSpace == 828 then pagetype = message('sandbox-notice-pagetype-module') else pagetype = message('sandbox-notice-pagetype-other') end local templateLink = makeWikilink(templateTitle.prefixedText) local compareUrl = env.compareUrl if compareUrl then local compareDisplay = message('sandbox-notice-compare-link-display') local compareLink = makeUrlLink(compareUrl, compareDisplay) text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink}) else text = text .. message('sandbox-notice-blurb', {pagetype, templateLink}) end -- Get the test cases page blurb if the page exists. This is something like -- "See also the companion subpage for [[Template:Foo/testcases|test cases]]." local testcasesTitle = env.testcasesTitle if testcasesTitle and testcasesTitle.exists then if testcasesTitle.contentModel == "Scribunto" then local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display') local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display') local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay) local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay) text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink}) else local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display') local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay) text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink}) end end -- Add the sandbox to the sandbox category. omargs.text = text .. makeCategoryLink(message('sandbox-category')) -- 'documentation-clear' return '<div class="' .. message('clear') .. '"></div>' .. require('Module:Message box').main('ombox', omargs) end function p.protectionTemplate(env) -- Generates the padlock icon in the top right. -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'protection-template' --> 'pp-template' -- 'protection-template-args' --> {docusage = 'yes'} local protectionLevels = env.protectionLevels if not protectionLevels then return nil end local editProt = protectionLevels.edit and protectionLevels.edit[1] local moveProt = protectionLevels.move and protectionLevels.move[1] -- 日本語版独自仕様: 編集保護と移動保護で保護レベルが異なる場合に、両方のアイコンを表示する local ret = '' if editProt then -- The page is edit-protected. ret = ret .. require('Module:Protection banner')._main{ message('protection-reason-edit'), small = true } end if moveProt and moveProt ~= editProt and moveProt ~= 'autoconfirmed' then -- The page is move-protected. ret = ret .. require('Module:Protection banner')._main{ action = 'move', small = true } end return ret end ---------------------------------------------------------------------------- -- Start box ---------------------------------------------------------------------------- p.startBox = makeInvokeFunc('_startBox') function p._startBox(args, env) --[[ -- This function generates the start box. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make -- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox -- which generate the box HTML. --]] env = env or p.getEnvironment(args) local links local content = args.content if not content or args[1] then -- No need to include the links if the documentation is on the template page itself. local linksData = p.makeStartBoxLinksData(args, env) if linksData then links = p.renderStartBoxLinks(linksData) end end -- Generate the start box html. local data = p.makeStartBoxData(args, env, links) if data then return p.renderStartBox(data) else -- User specified no heading. return nil end end function p.makeStartBoxLinksData(args, env) --[[ -- Does initial processing of data to make the [view] [edit] [history] [purge] links. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'view-link-display' --> 'view' -- 'edit-link-display' --> 'edit' -- 'history-link-display' --> 'history' -- 'purge-link-display' --> 'purge' -- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace' -- 'module-preload' --> 'Template:Documentation/preload-module-doc' -- 'docpage-preload' --> 'Template:Documentation/preload' -- 'create-link-display' --> 'create' --]] local subjectSpace = env.subjectSpace local title = env.title local docTitle = env.docTitle if not title or not docTitle then return nil end if docTitle.isRedirect then docTitle = docTitle.redirectTarget end local data = {} data.title = title data.docTitle = docTitle -- View, display, edit, and purge links if /doc exists. data.viewLinkDisplay = message('view-link-display') data.editLinkDisplay = message('edit-link-display') data.historyLinkDisplay = message('history-link-display') data.purgeLinkDisplay = message('purge-link-display') -- Create link if /doc doesn't exist. local preload = args.preload if not preload then if subjectSpace == 6 then -- File namespace preload = message('file-docpage-preload') elseif subjectSpace == 828 then -- Module namespace preload = message('module-preload') else preload = message('docpage-preload') end end data.preload = preload data.createLinkDisplay = message('create-link-display') return data end function p.renderStartBoxLinks(data) --[[ -- Generates the [view][edit][history][purge] or [create] links from the data table. -- @data - a table of data generated by p.makeStartBoxLinksData --]] local function escapeBrackets(s) -- Escapes square brackets with HTML entities. s = s:gsub('%[', '&#91;') -- Replace square brackets with HTML entities. s = s:gsub('%]', '&#93;') return s end local ret local docTitle = data.docTitle local title = data.title if docTitle.exists then local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay) local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay) local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay) local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay) ret = '[%s] [%s] [%s] [%s]' ret = escapeBrackets(ret) ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink) else local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay) ret = '[%s]' ret = escapeBrackets(ret) ret = mw.ustring.format(ret, createLink) end return ret end function p.makeStartBoxData(args, env, links) --[=[ -- Does initial processing of data to pass to the start-box render function, p.renderStartBox. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error. -- -- Messages: -- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]' -- 'template-namespace-heading' --> 'Template documentation' -- 'module-namespace-heading' --> 'Module documentation' -- 'file-namespace-heading' --> 'Summary' -- 'other-namespaces-heading' --> 'Documentation' -- 'testcases-create-link-display' --> 'create' --]=] local subjectSpace = env.subjectSpace if not subjectSpace then -- Default to an "other namespaces" namespace, so that we get at least some output -- if an error occurs. subjectSpace = 2 end local data = {} -- Heading local heading = args.heading -- Blank values are not removed. if heading == '' then -- Don't display the start box if the heading arg is defined but blank. return nil end if heading then data.heading = heading elseif subjectSpace == 10 then -- Template namespace data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading') elseif subjectSpace == 828 then -- Module namespace data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading') elseif subjectSpace == 6 then -- File namespace data.heading = message('file-namespace-heading') else data.heading = message('other-namespaces-heading') end -- Heading CSS local headingStyle = args['heading-style'] if headingStyle then data.headingStyleText = headingStyle else -- 'documentation-heading' data.headingClass = message('main-div-heading-class') end -- Data for the [view][edit][history][purge] or [create] links. if links then -- 'mw-editsection-like plainlinks' data.linksClass = message('start-box-link-classes') data.links = links end return data end function p.renderStartBox(data) -- Renders the start box html. -- @data - a table of data generated by p.makeStartBoxData. local sbox = mw.html.create('div') sbox -- 'documentation-startbox' :addClass(message('start-box-class')) :newline() :tag('span') :addClass(data.headingClass) :cssText(data.headingStyleText) :wikitext(data.heading) local links = data.links if links then sbox:tag('span') :addClass(data.linksClass) :attr('id', data.linksId) :wikitext(links) end return tostring(sbox) end ---------------------------------------------------------------------------- -- Documentation content ---------------------------------------------------------------------------- p.content = makeInvokeFunc('_content') function p._content(args, env) -- Displays the documentation contents -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment env = env or p.getEnvironment(args) local docTitle = env.docTitle local content = args.content if not content and docTitle and docTitle.exists then content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText} end -- The line breaks below are necessary so that "=== Headings ===" at the start and end -- of docs are interpreted correctly. return '\n' .. (content or '') .. '\n' end p.contentTitle = makeInvokeFunc('_contentTitle') function p._contentTitle(args, env) env = env or p.getEnvironment(args) local docTitle = env.docTitle if not args.content and docTitle and docTitle.exists then return docTitle.prefixedText else return '' end end ---------------------------------------------------------------------------- -- End box ---------------------------------------------------------------------------- p.endBox = makeInvokeFunc('_endBox') function p._endBox(args, env) --[=[ -- This function generates the end box (also known as the link box). -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- --]=] -- Get environment data. env = env or p.getEnvironment(args) local subjectSpace = env.subjectSpace local docTitle = env.docTitle if not subjectSpace or not docTitle then return nil end -- Check whether we should output the end box at all. Add the end -- box by default if the documentation exists or if we are in the -- user, module or template namespaces. local linkBox = args['link box'] if linkBox == 'off' or not ( docTitle.exists or subjectSpace == 2 or subjectSpace == 828 or subjectSpace == 10 ) then return nil end -- Assemble the link box. local text = '' if linkBox then text = text .. linkBox else text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]." if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then -- We are in the user, template or module namespaces. -- Add sandbox and testcases links. -- "Editors can experiment in this template's sandbox and testcases pages." text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />' if not args.content and not args[1] then -- "Please add categories to the /doc subpage." -- Don't show this message with inline docs or with an explicitly specified doc page, -- as then it is unclear where to add the categories. text = text .. (p.makeCategoriesBlurb(args, env) or '') end text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template" local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates. if printBlurb then text = text .. '<br />' .. printBlurb end end end local box = mw.html.create('div') box:attr('role', 'note') -- 'documentation-metadata' :addClass(message('end-box-class')) -- 'plainlinks' :addClass(message('end-box-plainlinks')) :wikitext(text) :done() return '\n' .. tostring(box) end function p.makeDocPageBlurb(args, env) --[=[ -- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)". -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'edit-link-display' --> 'edit' -- 'history-link-display' --> 'history' -- 'transcluded-from-blurb' --> -- 'The above [[Wikipedia:Template documentation|documentation]] -- is [[Help:Transclusion|transcluded]] from $1.' -- 'module-preload' --> 'Template:Documentation/preload-module-doc' -- 'create-link-display' --> 'create' -- 'create-module-doc-blurb' --> -- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].' --]=] local docTitle = env.docTitle if not docTitle then return nil end local ret if docTitle.exists then -- /doc exists; link to it. local docLink = makeWikilink(docTitle.prefixedText) local editUrl = docTitle:fullUrl{action = 'edit'} local editDisplay = message('edit-link-display') local editLink = makeUrlLink(editUrl, editDisplay) local historyUrl = docTitle:fullUrl{action = 'history'} local historyDisplay = message('history-link-display') local historyLink = makeUrlLink(historyUrl, historyDisplay) ret = message('transcluded-from-blurb', {docLink}) .. ' ' .. makeToolbar(editLink, historyLink) .. '<br />' elseif env.subjectSpace == 828 then -- /doc does not exist; ask to create it. local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')} local createDisplay = message('create-link-display') local createLink = makeUrlLink(createUrl, createDisplay) ret = message('create-module-doc-blurb', {createLink}) .. '<br />' end return ret end function p.makeExperimentBlurb(args, env) --[[ -- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages." -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'sandbox-link-display' --> 'sandbox' -- 'sandbox-edit-link-display' --> 'edit' -- 'compare-link-display' --> 'diff' -- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox' -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox' -- 'sandbox-create-link-display' --> 'create' -- 'mirror-edit-summary' --> 'Create sandbox version of $1' -- 'mirror-link-display' --> 'mirror' -- 'mirror-link-preload' --> 'Template:Documentation/mirror' -- 'sandbox-link-display' --> 'sandbox' -- 'testcases-link-display' --> 'testcases' -- 'testcases-edit-link-display'--> 'edit' -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox' -- 'testcases-create-link-display' --> 'create' -- 'testcases-link-display' --> 'testcases' -- 'testcases-edit-link-display' --> 'edit' -- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases' -- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases' -- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.' -- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.' --]] local subjectSpace = env.subjectSpace local templateTitle = env.templateTitle local sandboxTitle = env.sandboxTitle local testcasesTitle = env.testcasesTitle local templatePage = templateTitle.prefixedText if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then return nil end -- Make links. local sandboxLinks, testcasesLinks if sandboxTitle.exists then local sandboxPage = sandboxTitle.prefixedText local sandboxDisplay = message('sandbox-link-display') local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay) local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'} local sandboxEditDisplay = message('sandbox-edit-link-display') local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay) local compareUrl = env.compareUrl local compareLink if compareUrl then local compareDisplay = message('compare-link-display') compareLink = makeUrlLink(compareUrl, compareDisplay) end sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink) else local sandboxPreload if subjectSpace == 828 then sandboxPreload = message('module-sandbox-preload') else sandboxPreload = message('template-sandbox-preload') end local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload} local sandboxCreateDisplay = message('sandbox-create-link-display') local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay) local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)}) local mirrorPreload = message('mirror-link-preload') local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary} if subjectSpace == 828 then mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary} end local mirrorDisplay = message('mirror-link-display') local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay) sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink) end if testcasesTitle.exists then local testcasesPage = testcasesTitle.prefixedText local testcasesDisplay = message('testcases-link-display') local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay) local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'} local testcasesEditDisplay = message('testcases-edit-link-display') local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay) -- for Modules, add testcases run link if exists if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then local testcasesRunLinkDisplay = message('testcases-run-link-display') local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay) testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink) else testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink) end else local testcasesPreload if subjectSpace == 828 then testcasesPreload = message('module-testcases-preload') else testcasesPreload = message('template-testcases-preload') end local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload} local testcasesCreateDisplay = message('testcases-create-link-display') local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay) testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink) end local messageName if subjectSpace == 828 then messageName = 'experiment-blurb-module' else messageName = 'experiment-blurb-template' end return message(messageName, {sandboxLinks, testcasesLinks}) end function p.makeCategoriesBlurb(args, env) --[[ -- Generates the text "Please add categories to the /doc subpage." -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'doc-link-display' --> '/doc' -- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.' --]] local docTitle = env.docTitle if not docTitle then return nil end local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display')) return message('add-categories-blurb', {docPathLink}) end function p.makeSubpagesBlurb(args, env) --[[ -- Generates the "Subpages of this template" link. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'template-pagetype' --> 'template' -- 'module-pagetype' --> 'module' -- 'default-pagetype' --> 'page' -- 'subpages-link-display' --> 'Subpages of this $1' --]] local subjectSpace = env.subjectSpace local templateTitle = env.templateTitle if not subjectSpace or not templateTitle then return nil end local pagetype if subjectSpace == 10 then pagetype = message('template-pagetype') elseif subjectSpace == 828 then pagetype = message('module-pagetype') else pagetype = message('default-pagetype') end local subpagesLink = makeWikilink( 'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/', message('subpages-link-display', {pagetype}) ) return message('subpages-blurb', {subpagesLink}) end function p.makePrintBlurb(args, env) --[=[ -- Generates the blurb displayed when there is a print version of the template available. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'print-link-display' --> '/Print' -- 'print-blurb' --> 'A [[Help:Books/for experts#Improving the book layout|print version]]' -- .. ' of this template exists at $1.' -- .. ' If you make a change to this template, please update the print version as well.' -- 'display-print-category' --> true -- 'print-category' --> 'Templates with print versions' --]=] local printTitle = env.printTitle if not printTitle then return nil end local ret if printTitle.exists then local printLink = makeWikilink(printTitle.prefixedText, message('print-link-display')) ret = message('print-blurb', {printLink}) local displayPrintCategory = message('display-print-category', nil, 'boolean') if displayPrintCategory then ret = ret .. makeCategoryLink(message('print-category')) end end return ret end ---------------------------------------------------------------------------- -- Tracking categories ---------------------------------------------------------------------------- function p.addTrackingCategories(env) --[[ -- Check if {{documentation}} is transcluded on a /doc or /testcases page. -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'display-strange-usage-category' --> true -- 'doc-subpage' --> 'doc' -- 'testcases-subpage' --> 'testcases' -- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage' -- -- /testcases pages in the module namespace are not categorised, as they may have -- {{documentation}} transcluded automatically. --]] local title = env.title local subjectSpace = env.subjectSpace if not title or not subjectSpace then return nil end local subpage = title.subpageText local ret = '' if message('display-strange-usage-category', nil, 'boolean') and ( subpage == message('doc-subpage') or subjectSpace ~= 828 and subpage == message('testcases-subpage') ) then ret = ret .. makeCategoryLink(message('strange-usage-category')) end return ret end return p d6028d23a1bb7cedd0ce7f776655dc03805e5059 モジュール:Documentation/config 828 34 81 80 2024-02-09T10:36:38Z Kyushujin 2 1版 をインポートしました Scribunto text/plain ---------------------------------------------------------------------------------------------------- -- -- Configuration for Module:Documentation -- -- Here you can set the values of the parameters and messages used in Module:Documentation to -- localise it to your wiki and your language. Unless specified otherwise, values given here -- should be string values. ---------------------------------------------------------------------------------------------------- local cfg = {} -- Do not edit this line. ---------------------------------------------------------------------------------------------------- -- Protection template configuration ---------------------------------------------------------------------------------------------------- -- cfg['protection-reason-edit'] -- The protection reason for edit-protected templates to pass to -- [[Module:Protection banner]]. cfg['protection-reason-edit'] = 'template' --[[ ---------------------------------------------------------------------------------------------------- -- Sandbox notice configuration -- -- On sandbox pages the module can display a template notifying users that the current page is a -- sandbox, and the location of test cases pages, etc. The module decides whether the page is a -- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the -- messages that the notices contains. ---------------------------------------------------------------------------------------------------- --]] -- cfg['sandbox-notice-image'] -- The image displayed in the sandbox notice. cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]' --[[ -- cfg['sandbox-notice-pagetype-template'] -- cfg['sandbox-notice-pagetype-module'] -- cfg['sandbox-notice-pagetype-other'] -- The page type of the sandbox page. The message that is displayed depends on the current subject -- namespace. This message is used in either cfg['sandbox-notice-blurb'] or -- cfg['sandbox-notice-diff-blurb']. --]] cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:テンプレートのサンドボックスとテストケース|テンプレート・サンドボックス]]ページ' cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:テンプレートのサンドボックスとテストケース|モジュール・サンドボックス]]ページ' cfg['sandbox-notice-pagetype-other'] = 'サンドボックス・ページ' --[[ -- cfg['sandbox-notice-blurb'] -- cfg['sandbox-notice-diff-blurb'] -- cfg['sandbox-notice-diff-display'] -- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence -- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page -- type, which is either cfg['sandbox-notice-pagetype-template'], -- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what -- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between -- the sandbox and the main template. The display value of the diff link is set by -- cfg['sandbox-notice-compare-link-display']. --]] cfg['sandbox-notice-blurb'] = 'これは$2の$1です。' cfg['sandbox-notice-diff-blurb'] = 'これは$2 ($3)の$1です。' cfg['sandbox-notice-compare-link-display'] = '差分' --[[ -- cfg['sandbox-notice-testcases-blurb'] -- cfg['sandbox-notice-testcases-link-display'] -- cfg['sandbox-notice-testcases-run-blurb'] -- cfg['sandbox-notice-testcases-run-link-display'] -- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page -- corresponding to this sandbox that they can edit. $1 is a link to the test cases page. -- cfg['sandbox-notice-testcases-link-display'] is the display value for that link. -- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page -- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test -- cases page, and $2 is a link to the page to run it. -- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test -- cases. --]] cfg['sandbox-notice-testcases-blurb'] = '対応する$1・サブページもご確認ください。' cfg['sandbox-notice-testcases-link-display'] = 'テストケース' cfg['sandbox-notice-testcases-run-blurb'] = '対応する$1・サブページ ($2) もご確認ください。' cfg['sandbox-notice-testcases-run-link-display'] = '実行' -- cfg['sandbox-category'] -- A category to add to all template sandboxes. cfg['sandbox-category'] = 'テンプレート・サンドボックス' ---------------------------------------------------------------------------------------------------- -- Start box configuration ---------------------------------------------------------------------------------------------------- -- cfg['documentation-icon-wikitext'] -- The wikitext for the icon shown at the top of the template. cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]' -- cfg['template-namespace-heading'] -- The heading shown in the template namespace. cfg['template-namespace-heading'] = 'テンプレートの解説' -- cfg['module-namespace-heading'] -- The heading shown in the module namespace. cfg['module-namespace-heading'] = 'モジュールの解説' -- cfg['file-namespace-heading'] -- The heading shown in the file namespace. cfg['file-namespace-heading'] = '要約' -- cfg['other-namespaces-heading'] -- The heading shown in other namespaces. cfg['other-namespaces-heading'] = '解説' -- cfg['view-link-display'] -- The text to display for "view" links. cfg['view-link-display'] = '表示' -- cfg['edit-link-display'] -- The text to display for "edit" links. cfg['edit-link-display'] = '編集' -- cfg['history-link-display'] -- The text to display for "history" links. cfg['history-link-display'] = '履歴' -- cfg['purge-link-display'] -- The text to display for "purge" links. cfg['purge-link-display'] = 'キャッシュを破棄' -- cfg['create-link-display'] -- The text to display for "create" links. cfg['create-link-display'] = '作成' ---------------------------------------------------------------------------------------------------- -- Link box (end box) configuration ---------------------------------------------------------------------------------------------------- -- cfg['transcluded-from-blurb'] -- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page. cfg['transcluded-from-blurb'] = 'この[[Help:テンプレートの説明文|解説]]は、$1から[[Help:テンプレート#テンプレートとは|呼び出されて]]います。' --[[ -- cfg['create-module-doc-blurb'] -- Notice displayed in the module namespace when the documentation subpage does not exist. -- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the -- display cfg['create-link-display']. --]] cfg['create-module-doc-blurb'] = 'この[[Wikipedia:Lua|Scribuntoモジュール]]の解説ページを$1することができます。' ---------------------------------------------------------------------------------------------------- -- Experiment blurb configuration ---------------------------------------------------------------------------------------------------- --[[ -- cfg['experiment-blurb-template'] -- cfg['experiment-blurb-module'] -- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages. -- It is only shown in the template and module namespaces. With the default English settings, it -- might look like this: -- -- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. -- -- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links. -- -- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending -- on what namespace we are in. -- -- Parameters: -- -- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format: -- -- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display']) -- -- If the sandbox doesn't exist, it is in the format: -- -- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display']) -- -- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload'] -- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display'] -- loads a default edit summary of cfg['mirror-edit-summary']. -- -- $2 is a link to the test cases page. If the test cases page exists, it is in the following format: -- -- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display']) -- -- If the test cases page doesn't exist, it is in the format: -- -- cfg['testcases-link-display'] (cfg['testcases-create-link-display']) -- -- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the -- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current -- namespace. --]] cfg['experiment-blurb-template'] = "編集者は、このテンプレートを$1と$2で試すことができます。([[Wikipedia:テンプレートのサンドボックスとテストケース|解説]])" cfg['experiment-blurb-module'] = "編集者は、このモジュールを$1と$2で試すことができます。([[Wikipedia:テンプレートのサンドボックスとテストケース|解説]])" ---------------------------------------------------------------------------------------------------- -- Sandbox link configuration ---------------------------------------------------------------------------------------------------- -- cfg['sandbox-subpage'] -- The name of the template subpage typically used for sandboxes. cfg['sandbox-subpage'] = 'sandbox' -- cfg['template-sandbox-preload'] -- Preload file for template sandbox pages. cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox' -- cfg['module-sandbox-preload'] -- Preload file for Lua module sandbox pages. cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox' -- cfg['sandbox-link-display'] -- The text to display for "sandbox" links. cfg['sandbox-link-display'] = 'サンドボックス' -- cfg['sandbox-edit-link-display'] -- The text to display for sandbox "edit" links. cfg['sandbox-edit-link-display'] = '編集' -- cfg['sandbox-create-link-display'] -- The text to display for sandbox "create" links. cfg['sandbox-create-link-display'] = '作成' -- cfg['compare-link-display'] -- The text to display for "compare" links. cfg['compare-link-display'] = '差分' -- cfg['mirror-edit-summary'] -- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the -- template page. cfg['mirror-edit-summary'] = '$1のサンドボックスバージョンを作成' -- cfg['mirror-link-display'] -- The text to display for "mirror" links. cfg['mirror-link-display'] = '複製' -- cfg['mirror-link-preload'] -- The page to preload when a user clicks the "mirror" link. cfg['mirror-link-preload'] = 'Template:Documentation/mirror' ---------------------------------------------------------------------------------------------------- -- Test cases link configuration ---------------------------------------------------------------------------------------------------- -- cfg['testcases-subpage'] -- The name of the template subpage typically used for test cases. cfg['testcases-subpage'] = 'testcases' -- cfg['template-testcases-preload'] -- Preload file for template test cases pages. cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases' -- cfg['module-testcases-preload'] -- Preload file for Lua module test cases pages. cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases' -- cfg['testcases-link-display'] -- The text to display for "testcases" links. cfg['testcases-link-display'] = 'テストケース' -- cfg['testcases-edit-link-display'] -- The text to display for test cases "edit" links. cfg['testcases-edit-link-display'] = '編集' -- cfg['testcases-run-link-display'] -- The text to display for test cases "run" links. cfg['testcases-run-link-display'] = '作動' -- cfg['testcases-create-link-display'] -- The text to display for test cases "create" links. cfg['testcases-create-link-display'] = '作成' ---------------------------------------------------------------------------------------------------- -- Add categories blurb configuration ---------------------------------------------------------------------------------------------------- --[[ -- cfg['add-categories-blurb'] -- Text to direct users to add categories to the /doc subpage. Not used if the "content" or -- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a -- link to the /doc subpage with a display value of cfg['doc-link-display']. --]] cfg['add-categories-blurb'] = '$1のサブページにカテゴリを追加してください。' -- cfg['doc-link-display'] -- The text to display when linking to the /doc subpage. cfg['doc-link-display'] = '/doc' ---------------------------------------------------------------------------------------------------- -- Subpages link configuration ---------------------------------------------------------------------------------------------------- --[[ -- cfg['subpages-blurb'] -- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a -- display value of cfg['subpages-link-display']. In the English version this blurb is simply -- the link followed by a period, and the link display provides the actual text. --]] cfg['subpages-blurb'] = '$1' --[[ -- cfg['subpages-link-display'] -- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'], -- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in -- the template namespace, the module namespace, or another namespace. --]] cfg['subpages-link-display'] = 'この$1のサブページ一覧。' -- cfg['template-pagetype'] -- The pagetype to display for template pages. cfg['template-pagetype'] = 'テンプレート' -- cfg['module-pagetype'] -- The pagetype to display for Lua module pages. cfg['module-pagetype'] = 'モジュール' -- cfg['default-pagetype'] -- The pagetype to display for pages other than templates or Lua modules. cfg['default-pagetype'] = 'ページ' ---------------------------------------------------------------------------------------------------- -- Doc link configuration ---------------------------------------------------------------------------------------------------- -- cfg['doc-subpage'] -- The name of the subpage typically used for documentation pages. cfg['doc-subpage'] = 'doc' -- cfg['file-docpage-preload'] -- Preload file for documentation page in the file namespace. cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace' -- cfg['docpage-preload'] -- Preload file for template documentation pages in all namespaces. cfg['docpage-preload'] = 'Template:Documentation/preload' -- cfg['module-preload'] -- Preload file for Lua module documentation pages. cfg['module-preload'] = 'Template:Documentation/preload-module-doc' ---------------------------------------------------------------------------------------------------- -- Print version configuration ---------------------------------------------------------------------------------------------------- -- cfg['print-subpage'] -- The name of the template subpage used for print versions. cfg['print-subpage'] = 'Print' -- cfg['print-link-display'] -- The text to display when linking to the /Print subpage. cfg['print-link-display'] = '/Print' -- cfg['print-blurb'] -- Text to display if a /Print subpage exists. $1 is a link to the subpage with -- a display value of cfg['print-link-display']. cfg['print-blurb'] = '$1にこのテンプレートは[[:en:Help:Books/for experts#Improving the book layout|印刷用バージョンがあります]]。' .. 'もしこのテンプレートを更新した時は、印刷用バージョンも更新してください。' -- cfg['display-print-category'] -- Set to true to enable output of cfg['print-category'] if a /Print subpage exists. -- This should be a boolean value (either true or false). cfg['display-print-category'] = true -- cfg['print-category'] -- Category to output if cfg['display-print-category'] is set to true, and a /Print subpage exists. cfg['print-category'] = '' ---------------------------------------------------------------------------------------------------- -- HTML and CSS configuration ---------------------------------------------------------------------------------------------------- -- cfg['templatestyles'] -- The name of the TemplateStyles page where CSS is kept. -- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed. cfg['templatestyles'] = 'Module:Documentation/styles.css' -- cfg['container'] -- Class which can be used to set flex or grid CSS on the -- two child divs documentation and documentation-metadata cfg['container'] = 'documentation-container' -- cfg['main-div-classes'] -- Classes added to the main HTML "div" tag. cfg['main-div-classes'] = 'documentation' -- cfg['main-div-heading-class'] -- Class for the main heading for templates and modules and assoc. talk spaces cfg['main-div-heading-class'] = 'documentation-heading' -- cfg['start-box-class'] -- Class for the start box cfg['start-box-class'] = 'documentation-startbox' -- cfg['start-box-link-classes'] -- Classes used for the [view][edit][history] or [create] links in the start box. -- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]] cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks' -- cfg['end-box-class'] -- Class for the end box. cfg['end-box-class'] = 'documentation-metadata' -- cfg['end-box-plainlinks'] -- Plainlinks cfg['end-box-plainlinks'] = 'plainlinks' -- cfg['toolbar-class'] -- Class added for toolbar links. cfg['toolbar-class'] = 'documentation-toolbar' -- cfg['clear'] -- Just used to clear things. cfg['clear'] = 'documentation-clear' ---------------------------------------------------------------------------------------------------- -- Tracking category configuration ---------------------------------------------------------------------------------------------------- -- cfg['display-strange-usage-category'] -- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage -- or a /testcases subpage. This should be a boolean value (either true or false). cfg['display-strange-usage-category'] = true -- cfg['strange-usage-category'] -- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a -- /doc subpage or a /testcases subpage. cfg['strange-usage-category'] = '((documentation))の異常な使用があるページ' --[[ ---------------------------------------------------------------------------------------------------- -- End configuration -- -- Don't edit anything below this line. ---------------------------------------------------------------------------------------------------- --]] return cfg 3093010f18cd91593aecbda3f2cd842d19db7204 モジュール:Documentation/styles.css 828 35 83 82 2024-02-09T10:36:38Z Kyushujin 2 1版 をインポートしました text text/plain /* {{pp-template}} */ .documentation, .documentation-metadata { border: 1px solid #a2a9b1; background-color: #ecfcf4; clear: both; } .documentation { margin: 1em 0 0 0; padding: 1em; } .documentation-metadata { margin: 0.2em 0; /* same margin left-right as .documentation */ font-style: italic; padding: 0.4em 1em; /* same padding left-right as .documentation */ } .documentation-startbox { padding-bottom: 3px; border-bottom: 1px solid #aaa; margin-bottom: 1ex; } .documentation-heading { font-weight: bold; font-size: 125%; } .documentation-clear { /* Don't want things to stick out where they shouldn't. */ clear: both; } .documentation-toolbar { font-style: normal; font-size: 85%; } /* [[カテゴリ:テンプレートスタイル]] */ fea08746bcb1ff7d911742aad831da11f8e886da テンプレート:Main 10 36 85 84 2024-02-09T10:36:39Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{rellink|1 = 詳細は{{#if:{{{1<includeonly>|</includeonly>}}}|「{{see/core|{{{1}}}|{{{l1|{{{1}}}}}}}}」 | 「{{error|エラー:記事名が入力されていません}}」 }}{{#if:{{{2|}}}|{{#if:{{{3|}}}|、|および}}「{{see/core|{{{2}}}|{{{l2|{{{2}}}}}}}}」 }}{{#if:{{{3|}}}|{{#if:{{{4|}}}|、|、および}}「{{see/core|{{{3}}}|{{{l3|{{{3}}}}}}}}」 }}{{#if:{{{4|}}}|{{#if:{{{5|}}}|、|、および}}「{{see/core|{{{4}}}|{{{l4|{{{4}}}}}}}}」 }}{{#if:{{{5|}}}|{{#if:{{{6|}}}|、|、および}}「{{see/core|{{{5}}}|{{{l5|{{{5}}}}}}}}」 }}{{#if:{{{6|}}}|{{#if:{{{7|}}}|、|、および}}「{{see/core|{{{6}}}|{{{l6|{{{6}}}}}}}}」 }}{{#if:{{{7|}}}|{{#if:{{{8|}}}|、|、および}}「{{see/core|{{{7}}}|{{{l7|{{{7}}}}}}}}」 }}{{#if:{{{8|}}}|{{#if:{{{9|}}}|、|、および}}「{{see/core|{{{8}}}|{{{l8|{{{8}}}}}}}}」 }}{{#if:{{{9|}}}|{{#if:{{{10|}}}|、|、および}}「{{see/core|{{{9}}}|{{{l9|{{{9}}}}}}}}」 }}{{#if:{{{10|}}}|{{#if:{{{11|}}}|、|、および}}「{{see/core|{{{10}}}|{{{l10|{{{10}}}}}}}}」 }}{{#if:{{{11|}}}|{{#if:{{{12|}}}|、|、および}}「{{see/core|{{{11}}}|{{{l11|{{{11}}}}}}}}」 }}{{#if:{{{12|}}}|{{#if:{{{13|}}}|、|、および}}「{{see/core|{{{12}}}|{{{l12|{{{12}}}}}}}}」 }}{{#if:{{{13|}}}|{{#if:{{{14|}}}|、|、および}}「{{see/core|{{{13}}}|{{{l13|{{{13}}}}}}}}」 }}{{#if:{{{14|}}}|{{#if:{{{15|}}}|、|、および}}「{{see/core|{{{14}}}|{{{l14|{{{14}}}}}}}}」 }}{{#if:{{{15|}}}|、および「{{see/core|{{{15}}}|{{{l15|{{{15}}}}}}}}」 }}{{#if:{{{16|}}}|…{{error|最大15記事までです。}} }}を参照}}<noinclude> {{Documentation}} </noinclude> db94b24594039a380fed8cbcaba6af6e742a162c テンプレート:Para 10 37 87 86 2024-02-09T10:36:39Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <code class="nowrap" style="{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">&#124;{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}&#61;}}{{{2|}}}</code><noinclude> {{Documentation}}</noinclude> 34553ac52133be16b1e6cabcacbcc7a4b5eeeefc テンプレート:Multicol 10 38 89 88 2024-02-09T10:36:40Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly>[[Category:段組みにテーブルを使用している記事]] {| class="{{{class|}}} multicol" role="presentation" style="padding: 0; border: 0; border-collapse: collapse; background-color: transparent; table-layout: fixed; width: {{{1|100%}}}" |- valign="top" | style="padding-right:{{{2|1.5em}}};" | </includeonly><noinclude> {{documentation}}</noinclude> b145a8f9425fb37716ad1988b5ea54c24441fb71 テンプレート:Multicol-break 10 39 91 90 2024-02-09T10:36:40Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly>&#32; | style="padding-right: {{{1|1.5em}}};"| </includeonly><noinclude> {{Documentation|Template:Multicol/doc}} [[Category:段組みテンプレート|Multicol-break]] </noinclude> b4fedad92a028aa95c4d4b9f4644c76b3c35a378 テンプレート:Multicol-end 10 40 93 92 2024-02-09T10:36:40Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly>&#32; |}</includeonly><noinclude> {{Documentation|Template:Multicol/doc}} </noinclude> 59156d19d925ddfd29a3c765b7e4704fe21d8b15 テンプレート:Lua 10 41 95 94 2024-02-09T10:36:41Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude> {{Documentation}} </noinclude> 8797a825a10cd0b3c371fd4d94209ea095258122 モジュール:Lua banner 828 42 97 96 2024-02-09T10:36:41Z Kyushujin 2 1版 をインポートしました Scribunto text/plain -- {{lua}}というテンプレートで使用されるモジュールです。 local yesno = require('Module:Yesno') local mList = require('Module:List') local mTableTools = require('Module:TableTools') local mMessageBox = require('Module:Message box') local p = {} function p.main(frame) local origArgs = frame:getParent().args local args = {} for k, v in pairs(origArgs) do v = v:match('^%s*(.-)%s*$') if v ~= '' then args[k] = v end end return p._main(args) end function p._main(args) local modules = mTableTools.compressSparseArray(args) local box = p.renderBox(modules) local trackingCategories = p.renderTrackingCategories(args, modules) return box .. trackingCategories end function p.renderBox(modules) local boxArgs = {} if #modules < 1 then boxArgs.text = '<strong class="error">エラー: モジュール名が指定されていません</strong>' else local moduleLinks = {} for i, module in ipairs(modules) do moduleLinks[i] = string.format('[[:%s]]', module) end local moduleList = mList.makeList('bulleted', moduleLinks) boxArgs.text = '[[Wikipedia:Lua|Lua]]モジュールを使用しています:' .. moduleList end boxArgs.type = 'notice' boxArgs.small = true boxArgs.image = '[[File:Lua-logo-nolabel.svg|30px|alt=Lua logo|link=Wikipedia:Lua]]' return mMessageBox.main('mbox', boxArgs) end function p.renderTrackingCategories(args, modules, titleObj) if yesno(args.nocat) then return '' end local cats = {} -- Error category if #modules < 1 then cats[#cats + 1] = '' end -- Lua templates category titleObj = titleObj or mw.title.getCurrentTitle() local subpageBlacklist = { doc = true, sandbox = true, sandbox2 = true, testcases = true } if titleObj.namespace == 10 and not subpageBlacklist[titleObj.subpageText] then local category = args.category if not category then --[[ local categories = { ['Module:String'] = '', ['Module:Math'] = '', ['Module:BaseConvert'] = '', ['Module:Citation'] = '' } categories['Module:Citation/CS1'] = categories['Module:Citation'] category = modules[1] and categories[modules[1]] --]] category = category or 'Luaを利用するテンプレート' end cats[#cats + 1] = category end for i, cat in ipairs(cats) do cats[i] = string.format('[[Category:%s]]', cat) end return table.concat(cats) end return p fe9e40fdfaa53c99094a4c02496eba0231cd1181 テンプレート:使用箇所の多いテンプレート 10 43 99 98 2024-02-09T10:36:42Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{ombox | type = content | text = '''この{{ #switch:{{NAMESPACE}} |モジュール=Luaモジュール |#default=テンプレート }}は<span class="plainlinks">[https://templatecount.toolforge.org/index.php?lang=ja&namespace={{NAMESPACENUMBER:{{FULLPAGENAME}}}}&name={{PAGENAMEE}} {{#if:{{{1|}}}|{{{1}}}|多く}}のページ]で使われています。</span>'''<br />余計な混乱やサーバーへの負荷を避けるために、どんな変更でも最初は{{ #switch:{{NAMESPACE}} |モジュール=モジュール |#default=テンプレート }}の[[{{ #switch: {{SUBPAGENAME}} | doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}} | #default = {{SUBJECTPAGENAME}} }}/sandbox|サンドボックス・サブページ]]、[[{{ #switch: {{SUBPAGENAME}} | doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}} | #default = {{SUBJECTPAGENAME}} }}/testcases|テストケース・サブページ]]{{ #switch:{{NAMESPACE}} |モジュール= |#default=もしくはあなた自身の[[Wikipedia:利用者ページ|利用者スペース]]の[[特別:Mypage/sandbox|ページ]] }}で試すべきです。そうすれば、試した変更を1度の編集でこの{{ #switch:{{NAMESPACE}} |モジュール=モジュール |#default=テンプレート }}に加えることができます。しかし、最初にあなたの提案した変更を、{{#if:{{{2|}}}|[[{{{2}}}]]|[[{{ #switch: {{SUBPAGENAME}} | doc | sandbox = {{TALKSPACE}}:{{BASEPAGENAME}} | #default = {{TALKPAGENAME}} }}|この項目のノート]]}}で議論するようにお願いします。 }}<noinclude> {{Documentation}} <!-- カテゴリはここではなく/doc サブページに、言語間リンクはウィキデータ加えてください--> </noinclude> a148907663479c156929b264632034280e8da800 モジュール:Message box/ombox.css 828 44 101 100 2024-02-09T10:36:42Z Kyushujin 2 1版 をインポートしました text text/plain /* {{pp-template}} */ .ombox { margin: 4px 0; border-collapse: collapse; border: 1px solid #a2a9b1; /* Default "notice" gray */ background-color: #f8f9fa; box-sizing: border-box; } /* For the "small=yes" option. */ .ombox.mbox-small { font-size: 88%; line-height: 1.25em; } .ombox-speedy { border: 2px solid #b32424; /* Red */ background-color: #fee7e6; /* Pink */ } .ombox-delete { border: 2px solid #b32424; /* Red */ } .ombox-content { border: 1px solid #f28500; /* Orange */ } .ombox-style { border: 1px solid #fc3; /* Yellow */ } .ombox-move { border: 1px solid #9932cc; /* Purple */ } .ombox-protection { border: 2px solid #a2a9b1; /* Gray-gold */ } .ombox .mbox-text { border: none; /* @noflip */ padding: 0.25em 0.9em; width: 100%; font-size: 90%; } .ombox .mbox-image { border: none; /* @noflip */ padding: 2px 0 2px 0.9em; text-align: center; } .ombox .mbox-imageright { border: none; /* @noflip */ padding: 2px 0.9em 2px 0; text-align: center; } /* An empty narrow cell */ .ombox .mbox-empty-cell { border: none; padding: 0; width: 1px; } .ombox .mbox-invalid-type { text-align: center; } @media (min-width: 720px) { .ombox { margin: 4px 10%; } .ombox.mbox-small { /* @noflip */ clear: right; /* @noflip */ float: right; /* @noflip */ margin: 4px 0 4px 1em; width: 238px; } } /* [[Category:テンプレートスタイル]] */ aa83107d45d02063755df2eb5da51209ba058027 テンプレート:Documentation subpage 10 45 103 102 2024-02-09T10:36:43Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <onlyinclude><includeonly>{{ #ifeq: {{lc:{{SUBPAGENAME}}}} | {{{override|doc}}} | <!-- doc page --> </includeonly>{{ #ifeq: {{{doc-notice|show}}} | show | <!-- doc-notice show -->{{Ombox | type = notice | image = [[File:Edit-copy green.svg|40px]] | text = '''これは{{{1|[[{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}の[[Help:テンプレートの説明文|解説]][[Help:サブページ|サブページ]]です。'''<br />使用方法、[[Help:カテゴリ|カテゴリ]]、およびその他{{{種類|{{ #if: {{SUBJECTSPACE}} |{{SUBJECTSPACE ja}}ページ|記事}}}}}自体に含まれない情報を収容しています。 }} | <!-- doc-notice hide --> }}<includeonly> |<!-- not doc --> }}</includeonly><includeonly>{{ #ifeq: {{SUBPAGENAME}} | doc | {{ #ifeq: {{NAMESPACE}} | {{ns:10}} | [[Category:テンプレート文書|{{PAGENAME}}]] }} }}</includeonly></onlyinclude> {{Documentation}} 89540d8504640ca8921525ee47f5b8b2c093e737 テンプレート:SUBJECTSPACE ja 10 46 105 104 2024-02-09T10:36:43Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <onlyinclude>{{#switch:{{SUBJECTSPACE}} | {{ns:0}} = | {{ns:2}} = 利用者 | {{ns:4}} = ウィキペディア | {{ns:6}} = ファイル | {{ns:8}} = メディアウィキ | {{ns:10}} = テンプレート | {{ns:12}} = ヘルプ | {{ns:14}} = カテゴリ | {{ns:100}} = ウィキポータル | {{ns:102}} = ウィキプロジェクト | {{ns:828}} = モジュール | #default = {{SUBJECTSPACE}} }}</onlyinclude> {{Documentation}} 2dc741185336763d6b6302f8f7aa52be74a9adf8 モジュール:Infobox/former/doc 828 47 107 106 2024-02-09T10:36:43Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly>{{使用箇所の多いテンプレート|550,000以上}}</includeonly> 338a35e0387b9dedef216b30f3d69856a08bad7f テンプレート:Main other 10 48 109 108 2024-02-09T10:36:44Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{#switch: <!--If no or empty "demospace" parameter then detect namespace--> {{#if:{{{demospace|}}} | {{lc: {{{demospace}}} }} <!--Use lower case "demospace"--> | {{#ifeq:{{NAMESPACE}}|{{ns:0}} | main | other }} }} | main = {{{1|}}} | other | #default = {{{2|}}} }}<noinclude> {{Documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> 27fa655c176ab43a6a2b517aba54eab056222601 テンプレート:Code 10 49 111 110 2024-02-09T10:36:44Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{#tag:syntaxhighlight|{{{code|{{{1}}}}}}|lang={{{lang|{{{2|text}}}}}}|class={{{class|}}}|id={{{id|}}}|style={{{style|}}}|inline=1}}<noinclude> {{Documentation}}</noinclude> 828490bdc2b9805a4e417d387dd29f4383f44796 テンプレート:Pp-template 10 50 113 112 2024-02-09T10:36:44Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly>{{#invoke:Protection banner|main}}</includeonly><noinclude> {{Documentation}} </noinclude> 06392f515310490bd271ac55741f5dd1f0975304 テンプレート:Tag 10 51 115 114 2024-02-09T10:36:45Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <code style="white-space:nowrap">{{#switch:{{{2|pair}}} |c|close = <!--nothing--> |s|single |o|open |p|pair = &lt;{{{1|tag}}}{{#if:{{{params|}}}|&#32;{{{params}}}}} }}{{#switch:{{{2|pair}}} |c|close = {{{content|}}} |s|single = &#32;&#47;&gt; |o|open = &gt;{{{content|}}} |p|pair = &gt;{{{content|...}}} }}{{#switch:{{{2|pair}}} |s|single |o|open = <!--nothing--> |c|close |p|pair = &lt;&#47;{{{1|tag}}}&gt; }}</code><noinclude> {{documentation}}</noinclude> 1aad85c935fe594a647382862e264899bf6d6bc4 テンプレート:Collapse top 10 52 117 116 2024-02-09T10:36:45Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <div style="margin-left:{{{indent|0}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section --> {| <!-- Template:Collapse top --> class="mw-collapsible {{<includeonly>safesubst:</includeonly>#if:{{{expand|{{{collapse|}}}}}}||mw-collapsed}} {{{class|}}}" style="background: {{{bg1|transparent}}}; text-align: left; border: {{{border|1px}}} solid {{{b-color|Silver}}}; margin: 0.2em auto auto; width:{{<includeonly>safesubst:</includeonly>#if:{{{width|}}}|{{{width}}}|100%}}; clear: {{{clear|both}}}; padding: 1px;" |- ! style="background: {{{bg|#{{main other|F0F2F5|CCFFCC}}}}}; font-size:87%; padding:0.2em 0.3em; text-align:{{<includeonly>safesubst:</includeonly>#if:{{{left|}}}|left|{{<includeonly>safesubst:</includeonly>#if:{{{align|}}}|left|center}}}}; {{<includeonly>safesubst:</includeonly>#if:{{{fc|}}}|color: {{{fc}}};|}}" | <div style="display:inline;font-size:115%">{{{1|{{{title|{{{reason|{{{header|{{{heading|{{{result|Extended content}}}}}}}}}}}}}}}}}}</div> {{<includeonly>safesubst:</includeonly>#if:{{{warning|{{{2|}}}}}} |{{<includeonly>safesubst:</includeonly>!}}- {{<includeonly>safesubst:</includeonly>!}} style="text-align:center; font-style:italic;" {{<includeonly>safesubst:</includeonly>!}} {{{2|The following is a closed discussion. {{strongbad|Please do not modify it.}} }}} }} |- | style="border: solid {{{border2|1px Silver}}}; padding: {{{padding|0.6em}}}; background: {{{bg2|White}}};" {{<includeonly>safesubst:</includeonly>!}}<noinclude> {{lorem ipsum|3}} {{Collapse bottom}} {{Documentation}} </noinclude> 83a71e0b3d311baf7affdd76cc0731a2554c62f3 テンプレート:Collapse bottom 10 53 119 118 2024-02-09T10:36:45Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly>|}</div></includeonly><noinclude> [[Category:折りたたみ表示テンプレート|{{PAGENAME}}]] </noinclude> 4b2c2058be204c83d011bb731bd7bd1ddc21de50 テンプレート:Cot 10 54 121 120 2024-02-09T10:36:46Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki #転送 [[Template:Collapse top]] b43f038b7d7b98c4a285da4aa7d475ecebe82317 テンプレート:Cob 10 55 123 122 2024-02-09T10:36:46Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki #転送 [[Template:Collapse bottom]] de5ccb5b90ae27455ce8f18e40857ce90b299e2d モジュール:Arguments/doc 828 56 125 124 2024-02-09T10:36:47Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly>{{使用箇所の多いテンプレート|1,400,000以上}}{{pp-template}}</includeonly> <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | [[Category:Luaメタモジュール]] }}</includeonly> このモジュールは、{{Code|#invoke}} から渡された引数を処理できます。このモジュールは他のモジュールで使用するためのメタモジュールであり、{{Code|#invoke}} から直接呼び出すことはできません。 次のような機能があります。 * 引数のトリミングと空引数の削除。 * 引数を現在のフレームと親フレームの両方から同時に渡すことができます(後述)。 * 引数を、別のLuaモジュールまたはデバッグコンソールから直接渡すことができます。 * 多くの機能はカスタマイズ性を備えます == 基本 == モジュールをロードする必要があります。モジュールには <code>getArgs</code> という名前の関数が1つ含まれています。 <syntaxhighlight lang="lua"> local getArgs = require('Module:Arguments').getArgs </syntaxhighlight> メイン関数内でgetArgsを使用する最も基本的なシナリオです。変数 <code>args</code> は、{{Code|#invoke}} からの引数を含むテーブル型です。 <syntaxhighlight lang="lua"> local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) -- Main module code goes here. end return p </syntaxhighlight> === Recommended practice === However, the recommended practice is to use a function just for processing arguments from #invoke. This means that if someone calls your module from another Lua module you don't have to have a frame object available, which improves performance. <syntaxhighlight lang="lua"> local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) return p._main(args) end function p._main(args) -- Main module code goes here. end return p </syntaxhighlight> The way this is called from a template is <code><nowiki>{{#invoke:Example|main}}</nowiki></code> (optionally with some parameters like <code><nowiki>{{#invoke:Example|main|arg1=value1|arg2=value2}}</nowiki></code>), and the way this is called from a module is <syntaxhighlight lang=lua inline>require('Module:Example')._main({arg1 = 'value1', arg2 = value2, 'spaced arg3' = 'value3'})</syntaxhighlight>. What this second one does is construct a table with the arguments in it, then gives that table to the p._main(args) function, which uses it natively. === Multiple functions === If you want multiple functions to use the arguments, and you also want them to be accessible from #invoke, you can use a wrapper function. <syntaxhighlight lang="lua"> local getArgs = require('Module:Arguments').getArgs local p = {} local function makeInvokeFunc(funcName) return function (frame) local args = getArgs(frame) return p[funcName](args) end end p.func1 = makeInvokeFunc('_func1') function p._func1(args) -- Code for the first function goes here. end p.func2 = makeInvokeFunc('_func2') function p._func2(args) -- Code for the second function goes here. end return p </syntaxhighlight> === Options === The following options are available. They are explained in the sections below. <syntaxhighlight lang="lua"> local args = getArgs(frame, { trim = false, removeBlanks = false, valueFunc = function (key, value) -- Code for processing one argument end, frameOnly = true, parentOnly = true, parentFirst = true, wrappers = { 'Template:A wrapper template', 'Template:Another wrapper template' }, readOnly = true, noOverwrite = true }) </syntaxhighlight> === Trimming and removing blanks === Blank arguments often trip up coders new to converting MediaWiki templates to Lua. In template syntax, blank strings and strings consisting only of whitespace are considered false. However, in Lua, blank strings and strings consisting of whitespace are considered true. This means that if you don't pay attention to such arguments when you write your Lua modules, you might treat something as true that should actually be treated as false. To avoid this, by default this module removes all blank arguments. Similarly, whitespace can cause problems when dealing with positional arguments. Although whitespace is trimmed for named arguments coming from #invoke, it is preserved for positional arguments. Most of the time this additional whitespace is not desired, so this module trims it off by default. However, sometimes you want to use blank arguments as input, and sometimes you want to keep additional whitespace. This can be necessary to convert some templates exactly as they were written. If you want to do this, you can set the <code>trim</code> and <code>removeBlanks</code> arguments to <code>false</code>. <syntaxhighlight lang="lua"> local args = getArgs(frame, { trim = false, removeBlanks = false }) </syntaxhighlight> === Custom formatting of arguments === Sometimes you want to remove some blank arguments but not others, or perhaps you might want to put all of the positional arguments in lower case. To do things like this you can use the <code>valueFunc</code> option. The input to this option must be a function that takes two parameters, <code>key</code> and <code>value</code>, and returns a single value. This value is what you will get when you access the field <code>key</code> in the <code>args</code> table. Example 1: this function preserves whitespace for the first positional argument, but trims all other arguments and removes all other blank arguments. <syntaxhighlight lang="lua"> local args = getArgs(frame, { valueFunc = function (key, value) if key == 1 then return value elseif value then value = mw.text.trim(value) if value ~= '' then return value end end return nil end }) </syntaxhighlight> Example 2: this function removes blank arguments and converts all arguments to lower case, but doesn't trim whitespace from positional parameters. <syntaxhighlight lang="lua"> local args = getArgs(frame, { valueFunc = function (key, value) if not value then return nil end value = mw.ustring.lower(value) if mw.ustring.find(value, '%S') then return value end return nil end }) </syntaxhighlight> Note: the above functions will fail if passed input that is not of type <code>string</code> or <code>nil</code>. This might be the case if you use the <code>getArgs</code> function in the main function of your module, and that function is called by another Lua module. In this case, you will need to check the type of your input. This is not a problem if you are using a function specially for arguments from #invoke (i.e. you have <code>p.main</code> and <code>p._main</code> functions, or something similar). {{cot|Examples 1 and 2 with type checking}} Example 1: <syntaxhighlight lang="lua"> local args = getArgs(frame, { valueFunc = function (key, value) if key == 1 then return value elseif type(value) == 'string' then value = mw.text.trim(value) if value ~= '' then return value else return nil end else return value end end }) </syntaxhighlight> Example 2: <syntaxhighlight lang="lua"> local args = getArgs(frame, { valueFunc = function (key, value) if type(value) == 'string' then value = mw.ustring.lower(value) if mw.ustring.find(value, '%S') then return value else return nil end else return value end end }) </syntaxhighlight> {{cob}} Also, please note that the <code>valueFunc</code> function is called more or less every time an argument is requested from the <code>args</code> table, so if you care about performance you should make sure you aren't doing anything inefficient with your code. === Frames and parent frames === Arguments in the <code>args</code> table can be passed from the current frame or from its parent frame at the same time. To understand what this means, it is easiest to give an example. Let's say that we have a module called <code>Module:ExampleArgs</code>. This module prints the first two positional arguments that it is passed. {{cot|Module:ExampleArgs code}} <syntaxhighlight lang="lua"> local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) return p._main(args) end function p._main(args) local first = args[1] or '' local second = args[2] or '' return first .. ' ' .. second end return p </syntaxhighlight> {{cob}} <code>Module:ExampleArgs</code> is then called by <code>Template:ExampleArgs</code>, which contains the code <code><nowiki>{{#invoke:ExampleArgs|main|firstInvokeArg}}</nowiki></code>. This produces the result "firstInvokeArg". Now if we were to call <code>Template:ExampleArgs</code>, the following would happen: {| class="wikitable" style="width: 50em; max-width: 100%;" |- ! style="width: 60%;" | Code ! style="width: 40%;" | Result |- | <code><nowiki>{{ExampleArgs}}</nowiki></code> | firstInvokeArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg}}</nowiki></code> | firstInvokeArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg|secondTemplateArg}}</nowiki></code> | firstInvokeArg secondTemplateArg |} There are three options you can set to change this behaviour: <code>frameOnly</code>, <code>parentOnly</code> and <code>parentFirst</code>. If you set <code>frameOnly</code> then only arguments passed from the current frame will be accepted; if you set <code>parentOnly</code> then only arguments passed from the parent frame will be accepted; and if you set <code>parentFirst</code> then arguments will be passed from both the current and parent frames, but the parent frame will have priority over the current frame. Here are the results in terms of <code>Template:ExampleArgs</code>: ; frameOnly {| class="wikitable" style="width: 50em; max-width: 100%;" |- ! style="width: 60%;" | Code ! style="width: 40%;" | Result |- | <code><nowiki>{{ExampleArgs}}</nowiki></code> | firstInvokeArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg}}</nowiki></code> | firstInvokeArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg|secondTemplateArg}}</nowiki></code> | firstInvokeArg |} ; parentOnly {| class="wikitable" style="width: 50em; max-width: 100%;" |- ! style="width: 60%;" | Code ! style="width: 40%;" | Result |- | <code><nowiki>{{ExampleArgs}}</nowiki></code> | |- | <code><nowiki>{{ExampleArgs|firstTemplateArg}}</nowiki></code> | firstTemplateArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg|secondTemplateArg}}</nowiki></code> | firstTemplateArg secondTemplateArg |} ; parentFirst {| class="wikitable" style="width: 50em; max-width: 100%;" |- ! style="width: 60%;" | Code ! style="width: 40%;" | Result |- | <code><nowiki>{{ExampleArgs}}</nowiki></code> | firstInvokeArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg}}</nowiki></code> | firstTemplateArg |- | <code><nowiki>{{ExampleArgs|firstTemplateArg|secondTemplateArg}}</nowiki></code> | firstTemplateArg secondTemplateArg |} Notes: # If you set both the <code>frameOnly</code> and <code>parentOnly</code> options, the module won't fetch any arguments at all from #invoke. This is probably not what you want. # In some situations a parent frame may not be available, e.g. if getArgs is passed the parent frame rather than the current frame. In this case, only the frame arguments will be used (unless parentOnly is set, in which case no arguments will be used) and the <code>parentFirst</code> and <code>frameOnly</code> options will have no effect. === Wrappers === The ''wrappers'' option is used to specify a limited number of templates as ''wrapper templates'', that is, templates whose only purpose is to call a module. If the module detects that it is being called from a wrapper template, it will only check for arguments in the parent frame; otherwise it will only check for arguments in the frame passed to getArgs. This allows modules to be called by either #invoke or through a wrapper template without the loss of performance associated with having to check both the frame and the parent frame for each argument lookup. For example, the only content of [[Template:Side box]] (excluding content in {{tag|noinclude}} tags) is <code><nowiki>{{#invoke:Side box|main}}</nowiki></code>. There is no point in checking the arguments passed directly to the #invoke statement for this template, as no arguments will ever be specified there. We can avoid checking arguments passed to #invoke by using the ''parentOnly'' option, but if we do this then #invoke will not work from other pages either. If this were the case, the {{para|text|Some text}} in the code <code><nowiki>{{#invoke:Side box|main|text=Some text}}</nowiki></code> would be ignored completely, no matter what page it was used from. By using the <code>wrappers</code> option to specify 'Template:Side box' as a wrapper, we can make <code><nowiki>{{#invoke:Side box|main|text=Some text}}</nowiki></code> work from most pages, while still not requiring that the module check for arguments on the [[Template:Side box]] page itself. Wrappers can be specified either as a string, or as an array of strings. <syntaxhighlight lang="lua"> local args = getArgs(frame, { wrappers = 'Template:Wrapper template' }) </syntaxhighlight> <syntaxhighlight lang="lua"> local args = getArgs(frame, { wrappers = { 'Template:Wrapper 1', 'Template:Wrapper 2', -- Any number of wrapper templates can be added here. } }) </syntaxhighlight> Notes: # The module will automatically detect if it is being called from a wrapper template's /sandbox subpage, so there is no need to specify sandbox pages explicitly. # The ''wrappers'' option effectively changes the default of the ''frameOnly'' and ''parentOnly'' options. If, for example, ''parentOnly'' were explicitly set to 0 with ''wrappers'' set, calls via wrapper templates would result in both frame and parent arguments being loaded, though calls not via wrapper templates would result in only frame arguments being loaded. # If the ''wrappers'' option is set and no parent frame is available, the module will always get the arguments from the frame passed to <code>getArgs</code>. === Writing to the args table === Sometimes it can be useful to write new values to the args table. This is possible with the default settings of this module. (However, bear in mind that it is usually better coding style to create a new table with your new values and copy arguments from the args table as needed.) <syntaxhighlight lang="lua"> args.foo = 'some value' </syntaxhighlight> It is possible to alter this behaviour with the <code>readOnly</code> and <code>noOverwrite</code> options. If <code>readOnly</code> is set then it is not possible to write any values to the args table at all. If <code>noOverwrite</code> is set, then it is possible to add new values to the table, but it is not possible to add a value if it would overwrite any arguments that are passed from #invoke. === Ref tags === This module uses [[mw:Extension:Scribunto/Lua reference manual#Metatables|metatables]] to fetch arguments from #invoke. This allows access to both the frame arguments and the parent frame arguments without using the <code>pairs()</code> function. This can help if your module might be passed {{tag|ref}} tags as input. As soon as {{tag|ref}} tags are accessed from Lua, they are processed by the MediaWiki software and the reference will appear in the reference list at the bottom of the article. If your module proceeds to omit the reference tag from the output, you will end up with a phantom reference – a reference that appears in the reference list but without any number linking to it. This has been a problem with modules that use <code>pairs()</code> to detect whether to use the arguments from the frame or the parent frame, as those modules automatically process every available argument. This module solves this problem by allowing access to both frame and parent frame arguments, while still only fetching those arguments when it is necessary. The problem will still occur if you use <code>pairs(args)</code> elsewhere in your module, however. === Known limitations === The use of metatables also has its downsides. Most of the normal Lua table tools won't work properly on the args table, including the <code>#</code> operator, the <code>next()</code> function, and the functions in the table library. If using these is important for your module, you should use your own argument processing function instead of this module. d28a0a456f641c9a0ea9e0665371cd69596395ae テンプレート:MONTHNAME 10 57 127 126 2024-02-09T10:36:47Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly><!-- -->{{#switch: |{{{1|}}} = Missing required parameter 1=''month''! |{{#ifexpr:({{{1}}})<13 and abs{{{1}}}=trunc{{{1}}} and {{{1}}}||false}}={{#expr:{{{1}}} }}月 }}</includeonly><noinclude> {{Documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> c95afba518236d12b2a3964825dccfb9d7e63892 テンプレート:Flagicon 10 58 129 128 2024-02-09T10:36:47Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki [[ファイル:{{country flag alias {{{1}}}}}{{#switch:{{{1}}}|NPL=|NEP=|Nepal=|ネパール=|CHN1940=|DEU1945=|JPN1945=|RYU1952=|Ohio=|World=|世界=|#default={{!}}border}}|{{#if:{{{size|}}}|{{{size}}}|25x20px}}|{{{name|{{#if:{{{1|}}}|{{country alias {{{1}}}}}|不明}}の旗}}}{{#if:{{{nolink|}}}|{{!}}link=}}]]<noinclude> {{Documentation}} </noinclude> 3a53bf6821e61393e5c51edb7180a42cb810b267 モジュール:InfoboxImage 828 59 131 130 2024-02-09T10:36:48Z Kyushujin 2 1版 をインポートしました Scribunto text/plain -- Inputs: -- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link -- page - page to display for multipage images (DjVu) -- size - size to display the image -- maxsize - maximum size for image -- sizedefault - default size to display the image if size param is blank -- alt - alt text for image -- title - title text for image -- border - set to yes if border -- center - set to yes, if the image has to be centered -- upright - upright image param -- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it -- link - page to visit when clicking on image -- Outputs: -- Formatted image. -- More details available at the "Module:InfoboxImage/doc" page local i = {}; local placeholder_image = { "Blue - Replace this image female.svg", "Blue - Replace this image male.svg", "Female no free image yet.png", "Flag of None (square).svg", "Flag of None.svg", "Flag of.svg", "Green - Replace this image female.svg", "Green - Replace this image male.svg", "Image is needed female.svg", "Image is needed male.svg", "Location map of None.svg", "Male no free image yet.png", "Missing flag.png", "No flag.svg", "No free portrait.svg", "No portrait (female).svg", "No portrait (male).svg", "Red - Replace this image female.svg", "Red - Replace this image male.svg", "Replace this image female (blue).svg", "Replace this image female.svg", "Replace this image male (blue).svg", "Replace this image male.svg", "Silver - Replace this image female.svg", "Silver - Replace this image male.svg", "Replace this image.svg", "Cricket no pic.png", "CarersLogo.gif", "Diagram Needed.svg", "Example.jpg", "Image placeholder.png", "No male portrait.svg", "Nocover-upload.png", "NoDVDcover copy.png", "Noribbon.svg", "No portrait-BFD-test.svg", "Placeholder barnstar ribbon.png", "Project Trains no image.png", "Image-request.png", "Sin bandera.svg", "Sin escudo.svg", "Replace this image - temple.png", "Replace this image butterfly.png", "Replace this image.svg", "Replace this image1.svg", "Resolution angle.png", "Image-No portrait-text-BFD-test.svg", "Insert image here.svg", "No image available.png", "NO IMAGE YET square.png", "NO IMAGE YET.png", "No Photo Available.svg", "No Screenshot.svg", "No-image-available.jpg", "Null.png", "PictureNeeded.gif", "Place holder.jpg", "Unbenannt.JPG", "UploadACopyrightFreeImage.svg", "UploadAnImage.gif", "UploadAnImage.svg", "UploadAnImageShort.svg", "CarersLogo.gif", "Diagram Needed.svg", "No male portrait.svg", "NoDVDcover copy.png", "Placeholder barnstar ribbon.png", "Project Trains no image.png", "Image-request.png", "Noimage.gif", } function i.IsPlaceholder(image) -- change underscores to spaces image = mw.ustring.gsub(image, "_", " "); assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil') -- if image starts with [[ then remove that and anything after | if mw.ustring.sub(image,1,2) == "[[" then image = mw.ustring.sub(image,3); image = mw.ustring.gsub(image, "([^|]*)|.*", "%1"); assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil') end -- Trim spaces image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1'); assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil") -- remove prefix if exists local allNames = mw.site.namespaces[6].aliases allNames[#allNames + 1] = mw.site.namespaces[6].name allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName for i, name in ipairs(allNames) do if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then image = mw.ustring.sub(image, mw.ustring.len(name) + 2); break end end -- Trim spaces image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1'); -- capitalise first letter image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2); for i,j in pairs(placeholder_image) do if image == j then return true end end return false end function i.InfoboxImage(frame) local image = frame.args["image"]; if image == "" or image == nil then return ""; end if image == "&nbsp;" then return image; end if frame.args["suppressplaceholder"] ~= "no" then if i.IsPlaceholder(image) == true then return ""; end end if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then return ""; end if mw.ustring.sub(image,1,2) == "[[" then -- search for thumbnail images and add to tracking cat if found if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then return image .. "[[Category:Infobox内でサムネイル画像を使用しているページ]]"; elseif mw.title.getCurrentTitle().namespace == 0 then return image .. ""; else return image; end elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then return image; elseif mw.ustring.sub(image,1,1) == "<" then return image; elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then -- Found strip marker at begining, so pass don't process at all return image; elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then -- Found strip marker at begining, so pass don't process at all return image; else local result = ""; local page = frame.args["page"]; local size = frame.args["size"]; local maxsize = frame.args["maxsize"]; local sizedefault = frame.args["sizedefault"]; local alt = frame.args["alt"]; local link = frame.args["link"]; local title = frame.args["title"]; local border = frame.args["border"]; local upright = frame.args["upright"] or ""; local thumbtime = frame.args["thumbtime"] or ""; local center= frame.args["center"]; -- remove prefix if exists local allNames = mw.site.namespaces[6].aliases allNames[#allNames + 1] = mw.site.namespaces[6].name allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName for i, name in ipairs(allNames) do if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then image = mw.ustring.sub(image, mw.ustring.len(name) + 2); break end end if maxsize ~= "" and maxsize ~= nil then -- if no sizedefault then set to maxsize if sizedefault == "" or sizedefault == nil then sizedefault = maxsize end -- check to see if size bigger than maxsize if size ~= "" and size ~= nil then local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0; local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0; if sizenumber>maxsizenumber and maxsizenumber>0 then size = maxsize; end end end -- add px to size if just a number if (tonumber(size) or 0) > 0 then size = size .. "px"; end -- add px to sizedefault if just a number if (tonumber(sizedefault) or 0) > 0 then sizedefault = sizedefault .. "px"; end result = "[[File:" .. image; if page ~= "" and page ~= nil then result = result .. "|page=" .. page; end if size ~= "" and size ~= nil then result = result .. "|" .. size; elseif sizedefault ~= "" and sizedefault ~= nil then result = result .. "|" .. sizedefault; else result = result .. "|frameless"; end if center == "yes" then result = result .. "|center" end if alt ~= "" and alt ~= nil then result = result .. "|alt=" .. alt; end if link ~= "" and link ~= nil then result = result .. "|link=" .. link; end if border == "yes" then result = result .. "|border"; end if upright == "yes" then result = result .. "|upright"; elseif upright ~= "" then result = result .. "|upright=" .. upright; end if thumbtime ~= "" then result = result .. "|thumbtime=" .. thumbtime; end if title ~= "" and title ~= nil then result = result .. "|" .. title; elseif alt ~= "" and alt ~= nil then result = result .. "|" .. alt; end result = result .. "]]"; return result; end end return i; 0eb306ccad8c24df8eafc11c761743ced8ec3911 テンプレート:JPN 10 60 133 132 2024-02-09T10:36:48Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{Flagicon|JPN}} [[日本]]<noinclude> {{Documentation}} </noinclude> 57367ec5ec14e8aded8270eafb313b4075cc25bf テンプレート:Country flag alias JPN 10 61 135 134 2024-02-09T10:36:48Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki Flag of Japan.svg<noinclude> [[Category:Country flag aliasテンプレート|JPN]] </noinclude> 477156a85f8456c780ae71ab474d6793b0b6f0d8 テンプレート:Country alias JPN 10 62 137 136 2024-02-09T10:36:49Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki 日本<noinclude> [[Category:Country aliasテンプレート|JPN]] </noinclude> 10a9563dd41a1f6640b5ca2523adc217081ba85b テンプレート:Yesno 10 63 139 138 2024-02-09T10:36:49Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }} |no |n |false |0 = {{{no|}}} | = {{{blank|{{{no|}}}}}} |¬ = {{{¬|}}} |yes |y |true |1 = {{{yes|yes}}} |#default = {{{def|{{{yes|yes}}}}}} }}<noinclude> {{Documentation}} </noinclude> a06c5c6c22e3af653eec98c1f974c753e40e73d0 テンプレート:See also 10 64 141 140 2024-02-09T10:36:50Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly>{{rellink|1 = {{#if:{{{1|}}}|「{{see/core|{{{1}}}|{{{l1|{{{1}}}}}}}}」 | 「{{error|エラー:記事名が入力されていません}}」 }}{{#if:{{{2|}}}|{{#if:{{{3|}}}|、|および}}「{{see/core|{{{2}}}|{{{l2|{{{2}}}}}}}}」 }}{{#if:{{{3|}}}|{{#if:{{{4|}}}|、|、および}}「{{see/core|{{{3}}}|{{{l3|{{{3}}}}}}}}」 }}{{#if:{{{4|}}}|{{#if:{{{5|}}}|、|、および}}「{{see/core|{{{4}}}|{{{l4|{{{4}}}}}}}}」 }}{{#if:{{{5|}}}|{{#if:{{{6|}}}|、|、および}}「{{see/core|{{{5}}}|{{{l5|{{{5}}}}}}}}」 }}{{#if:{{{6|}}}|{{#if:{{{7|}}}|、|、および}}「{{see/core|{{{6}}}|{{{l6|{{{6}}}}}}}}」 }}{{#if:{{{7|}}}|{{#if:{{{8|}}}|、|、および}}「{{see/core|{{{7}}}|{{{l7|{{{7}}}}}}}}」 }}{{#if:{{{8|}}}|{{#if:{{{9|}}}|、|、および}}「{{see/core|{{{8}}}|{{{l8|{{{8}}}}}}}}」 }}{{#if:{{{9|}}}|{{#if:{{{10|}}}|、|、および}}「{{see/core|{{{9}}}|{{{l9|{{{9}}}}}}}}」 }}{{#if:{{{10|}}}|{{#if:{{{11|}}}|、|、および}}「{{see/core|{{{10}}}|{{{l10|{{{10}}}}}}}}」 }}{{#if:{{{11|}}}|{{#if:{{{12|}}}|、|、および}}「{{see/core|{{{11}}}|{{{l11|{{{11}}}}}}}}」 }}{{#if:{{{12|}}}|{{#if:{{{13|}}}|、|、および}}「{{see/core|{{{12}}}|{{{l12|{{{12}}}}}}}}」 }}{{#if:{{{13|}}}|{{#if:{{{14|}}}|、|、および}}「{{see/core|{{{13}}}|{{{l13|{{{13}}}}}}}}」 }}{{#if:{{{14|}}}|{{#if:{{{15|}}}|、|、および}}「{{see/core|{{{14}}}|{{{l14|{{{14}}}}}}}}」 }}{{#if:{{{15|}}}|、および「{{see/core|{{{15}}}|{{{l15|{{{15}}}}}}}}」 }}{{#if:{{{16|}}}|…{{error|最大15記事までです。}} }}も参照}}</includeonly><noinclude> {{Documentation}}</noinclude> d7d094c7b5239ef92bfdc9ab69b283faaabf21ec テンプレート:Greater color contrast ratio 10 65 143 142 2024-02-09T10:36:50Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly>{{#invoke:Color contrast|greatercontrast}}</includeonly><noinclude> {{Documentation}} </noinclude> cf8f2a0c41a597f4ccd122afc981f8272233193f モジュール:Color contrast 828 66 145 144 2024-02-09T10:36:50Z Kyushujin 2 1版 をインポートしました Scribunto text/plain -- -- This module implements -- {{Color contrast ratio}} -- {{Greater color contrast ratio}} -- {{ColorToLum}} -- {{RGBColorToLum}} -- local p = {} local HTMLcolor = mw.loadData( 'Module:Color contrast/colors' ) local function sRGB (v) if (v <= 0.03928) then v = v / 12.92 else v = math.pow((v+0.055)/1.055, 2.4) end return v end local function rgbdec2lum(R, G, B) if ( 0 <= R and R < 256 and 0 <= G and G < 256 and 0 <= B and B < 256 ) then return 0.2126 * sRGB(R/255) + 0.7152 * sRGB(G/255) + 0.0722 * sRGB(B/255) else return '' end end local function hsl2lum(h, s, l) if ( 0 <= h and h < 360 and 0 <= s and s <= 1 and 0 <= l and l <= 1 ) then local c = (1 - math.abs(2*l - 1))*s local x = c*(1 - math.abs( math.fmod(h/60, 2) - 1) ) local m = l - c/2 local r, g, b = m, m, m if( 0 <= h and h < 60 ) then r = r + c g = g + x elseif( 60 <= h and h < 120 ) then r = r + x g = g + c elseif( 120 <= h and h < 180 ) then g = g + c b = b + x elseif( 180 <= h and h < 240 ) then g = g + x b = b + c elseif( 240 <= h and h < 300 ) then r = r + x b = b + c elseif( 300 <= h and h < 360 ) then r = r + c b = b + x end return rgbdec2lum(255*r, 255*g, 255*b) else return '' end end local function color2lum(c) if (c == nil) then return '' end -- html '#' entity c = c:gsub("&#35;", "#") -- whitespace c = c:match( '^%s*(.-)[%s;]*$' ) -- unstrip nowiki strip markers c = mw.text.unstripNoWiki(c) -- lowercase c = c:lower() -- first try to look it up local L = HTMLcolor[c] if (L ~= nil) then return L end -- convert from hsl if mw.ustring.match(c,'^hsl%([%s]*[0-9][0-9%.]*[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then local h, s, l = mw.ustring.match(c,'^hsl%([%s]*([0-9][0-9%.]*)[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$') return hsl2lum(tonumber(h), tonumber(s)/100, tonumber(l)/100) end -- convert from rgb if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*%)$') then local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*%)$') return rgbdec2lum(tonumber(R), tonumber(G), tonumber(B)) end -- convert from rgb percent if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$') return rgbdec2lum(255*tonumber(R)/100, 255*tonumber(G)/100, 255*tonumber(B)/100) end -- remove leading # (if there is one) and whitespace c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$') -- split into rgb local cs = mw.text.split(c or '', '') if( #cs == 6 ) then local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[2]) local G = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[4]) local B = 16*tonumber('0x' .. cs[5]) + tonumber('0x' .. cs[6]) return rgbdec2lum(R, G, B) elseif ( #cs == 3 ) then local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[1]) local G = 16*tonumber('0x' .. cs[2]) + tonumber('0x' .. cs[2]) local B = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[3]) return rgbdec2lum(R, G, B) end -- failure, return blank return '' end -- This exports the function for use in other modules. -- The colour is passed as a string. function p._lum(color) return color2lum(color) end function p._greatercontrast(args) local bias = tonumber(args['bias'] or '0') or 0 local css = (args['css'] and args['css'] ~= '') and true or false local v1 = color2lum(args[1] or '') local c2 = args[2] or '#FFFFFF' local v2 = color2lum(c2) local c3 = args[3] or '#000000' local v3 = color2lum(c3) local ratio1 = -1; local ratio2 = -1; if (type(v1) == 'number' and type(v2) == 'number') then ratio1 = (v2 + 0.05)/(v1 + 0.05) ratio1 = (ratio1 < 1) and 1/ratio1 or ratio1 end if (type(v1) == 'number' and type(v3) == 'number') then ratio2 = (v3 + 0.05)/(v1 + 0.05) ratio2 = (ratio2 < 1) and 1/ratio2 or ratio2 end if css then local c1 = args[1] or '' if mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then c1 = '#' .. c1 end if mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then c2 = '#' .. c2 end if mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then c3 = '#' .. c3 end return 'background-color:' .. c1 .. '; color:' .. ((ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or '') .. ';' end return (ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or '' end function p._ratio(args) local v1 = color2lum(args[1]) local v2 = color2lum(args[2]) if (type(v1) == 'number' and type(v2) == 'number') then -- v1 should be the brighter of the two. if v2 > v1 then v1, v2 = v2, v1 end return (v1 + 0.05)/(v2 + 0.05) else return args['error'] or '?' end end function p._styleratio(args) local style = (args[1] or ''):lower() local bg, fg = 'white', 'black' local lum_bg, lum_fg = 1, 0 if args[2] then local lum = color2lum(args[2]) if lum ~= '' then bg, lum_bg = args[2], lum end end if args[3] then local lum = color2lum(args[3]) if lum ~= '' then fg, lum_fg = args[3], lum end end local slist = mw.text.split(mw.ustring.gsub(mw.ustring.gsub(style or '', '&#[Xx]23;', '#'), '&#35;', '#'), ';') for k = 1,#slist do local s = slist[k] local k,v = s:match( '^[%s]*([^:]-):([^:]-)[%s;]*$' ) k = k or '' v = v or '' if (k:match('^[%s]*(background)[%s]*$') or k:match('^[%s]*(background%-color)[%s]*$')) then local lum = color2lum(v) if( lum ~= '' ) then bg, lum_bg = v, lum end elseif (k:match('^[%s]*(color)[%s]*$')) then local lum = color2lum(v) if( lum ~= '' ) then bg, lum_fg = v, lum end end end if lum_bg > lum_fg then return (lum_bg + 0.05)/(lum_fg + 0.05) else return (lum_fg + 0.05)/(lum_bg + 0.05) end end --[[ Use {{#invoke:Color contrast|somecolor}} directly or {{#invoke:Color contrast}} from a wrapper template. Parameters: -- |1= — required; A color to check. --]] function p.lum(frame) local color = frame.args[1] or frame:getParent().args[1] return p._lum(color) end function p.ratio(frame) local args = frame.args[1] and frame.args or frame:getParent().args return p._ratio(args) end function p.styleratio(frame) local args = frame.args[1] and frame.args or frame:getParent().args return p._styleratio(args) end function p.greatercontrast(frame) local args = frame.args[1] and frame.args or frame:getParent().args return p._greatercontrast(args) end return p 1e399769117591366a63f62996c9a407077cc711 モジュール:Color contrast/colors 828 67 147 146 2024-02-09T10:36:51Z Kyushujin 2 1版 をインポートしました Scribunto text/plain return { aliceblue = 0.92880068253475, antiquewhite = 0.84646951707754, aqua = 0.7874, aquamarine = 0.8078549208338, azure = 0.97265264954166, beige = 0.8988459998705, bisque = 0.80732327372979, black = 0, blanchedalmond = 0.85084439608156, blue = 0.0722, blueviolet = 0.12622014321946, brown = 0.098224287876511, burlywood = 0.51559844533893, cadetblue = 0.29424681085422, chartreuse = 0.76032025902623, chocolate = 0.23898526114557, coral = 0.37017930872924, cornflowerblue = 0.30318641994179, cornsilk = 0.93562110372965, crimson = 0.16042199953026, cyan = 0.7874, darkblue = 0.018640801980939, darkcyan = 0.20329317839046, darkgoldenrod = 0.27264703559993, darkgray = 0.39675523072563, darkgreen = 0.091143429047575, darkgrey = 0.39675523072563, darkkhaki = 0.45747326349994, darkmagenta = 0.07353047651207, darkolivegreen = 0.12651920884889, darkorange = 0.40016167026524, darkorchid = 0.13413142174857, darkred = 0.054889674531132, darksalmon = 0.40541471563381, darkseagreen = 0.43789249325969, darkslateblue = 0.065792846227988, darkslategray = 0.067608151928044, darkslategrey = 0.067608151928044, darkturquoise = 0.4874606277449, darkviolet = 0.10999048339343, deeppink = 0.23866895828276, deepskyblue = 0.44481603395575, dimgray = 0.14126329114027, dimgrey = 0.14126329114027, dodgerblue = 0.27442536991456, firebrick = 0.10724525535015, floralwhite = 0.95922484825004, forestgreen = 0.18920812076002, fuchsia = 0.2848, gainsboro = 0.71569350050648, ghostwhite = 0.94311261886323, gold = 0.69860877428159, goldenrod = 0.41919977809569, gray = 0.2158605001139, green = 0.15438342968146, greenyellow = 0.80609472611453, grey = 0.2158605001139, honeydew = 0.96336535554782, hotpink = 0.34658438169715, indianred = 0.21406134963884, indigo = 0.03107561486337, ivory = 0.99071270600615, khaki = 0.77012343394121, lavender = 0.80318750514521, lavenderblush = 0.90172748631046, lawngreen = 0.73905893124963, lemonchiffon = 0.94038992245622, lightblue = 0.63709141280807, lightcoral = 0.35522120733135, lightcyan = 0.94587293494829, lightgoldenrodyellow = 0.93348351018297, lightgray = 0.65140563741982, lightgreen = 0.69091979956865, lightgrey = 0.65140563741982, lightpink = 0.58566152734898, lightsalmon = 0.4780675225206, lightseagreen = 0.35050145117042, lightskyblue = 0.56195637618331, lightslategray = 0.23830165007287, lightslategrey = 0.23830165007287, lightsteelblue = 0.53983888284666, lightyellow = 0.98161818392882, lime = 0.7152, limegreen = 0.44571042246098, linen = 0.88357340984379, magenta = 0.2848, maroon = 0.045891942324215, mediumaquamarine = 0.49389703310801, mediumblue = 0.044077780212328, mediumorchid = 0.21639251153773, mediumpurple = 0.22905858091648, mediumseagreen = 0.34393112338131, mediumslateblue = 0.20284629471622, mediumspringgreen = 0.70704308194184, mediumturquoise = 0.5133827926448, mediumvioletred = 0.14371899849357, midnightblue = 0.02071786635086, mintcream = 0.97834604947588, mistyrose = 0.82183047859185, moccasin = 0.80083000991567, navajowhite = 0.76519682342785, navy = 0.015585128108224, oldlace = 0.91900633405549, olive = 0.20027537200568, olivedrab = 0.22593150951929, orange = 0.4817026703631, orangered = 0.25516243753416, orchid = 0.31348806761439, palegoldenrod = 0.78792647887614, palegreen = 0.77936759006353, paleturquoise = 0.76436077921714, palevioletred = 0.28754994117889, papayawhip = 0.87797100199835, peachpuff = 0.74905589878251, peru = 0.30113074877936, pink = 0.63271070702466, plum = 0.45734221587969, powderblue = 0.68254586500605, purple = 0.061477070432439, rebeccapurple = 0.07492341159447, red = 0.2126, rosybrown = 0.32319457649407, royalblue = 0.16663210743188, saddlebrown = 0.097922285020521, salmon = 0.36977241527596, sandybrown = 0.46628543696283, seagreen = 0.19734199706275, seashell = 0.92737862206922, sienna = 0.13697631337098, silver = 0.52711512570581, skyblue = 0.55291668518184, slateblue = 0.14784278062136, slategray = 0.20896704076536, slategrey = 0.20896704076536, snow = 0.96533341834849, springgreen = 0.73052306068529, steelblue = 0.20562642207625, tan = 0.48237604163921, teal = 0.16996855778968, thistle = 0.56818401093733, tomato = 0.30638612719415, turquoise = 0.5895536427578, violet = 0.40315452986676, wheat = 0.74909702820482, white = 1, whitesmoke = 0.91309865179342, yellow = 0.9278, yellowgreen = 0.50762957208707, } 6ae47fdb24de4eed5ec26d203faf5341a388987b テンプレート:Country flag alias World 10 68 149 148 2024-02-09T10:36:51Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki Perlshaper orthographic example1.svg<noinclude> [[Category:Country flag aliasテンプレート|world]] </noinclude> b2514f0210d302a65e57fd00f301969cbf840478 テンプレート:Country alias World 10 69 151 150 2024-02-09T10:36:51Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki 世界<noinclude> [[Category:Country aliasテンプレート|World]] </noinclude> c3b761cbad6b4bca611ed2786ead16fd9412a528 テンプレート:N/a 10 70 153 152 2024-02-09T10:36:52Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <noinclude>{|class=wikitable |</noinclude><onlyinclude>style="background:#ececec;color:#2c2c2c;vertical-align:middle;font-size:smaller;text-align:{{{align|center}}};{{{style|}}}" class="table-na"|{{{1|N/A}}}</onlyinclude><noinclude> |}{{Documentation}}</noinclude> 4c6b5add89ae854fa9cfa8f8417928f4608b49a6 テンプレート:Start date and age 10 71 155 154 2024-02-09T10:36:52Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <includeonly><!-- IMPLEMENTATION OF DATE -->{{#if: {{{1|}}}<!-- -->|{{#if: {{{2|}}}<!-- -->|{{#if: {{{3|}}}<!-- -->|<span style="white-space:nowrap;">{{{1}}}年{{MONTHNAME|{{{2}}}}}{{#expr:{{{3}}}}}日</span><!-- -->|<span style="white-space:nowrap;">{{{1}}}年{{MONTHNAME|{{{2}}}}}</span><!-- -->}}<!-- -->|<span style="white-space:nowrap;">{{{1}}}年</span><!-- -->}}<!-- --><span class="noprint">{{#ifeq:{{yesno|{{{br|no}}}}}|yes|<br>|&#032;}}{{#ifeq:{{yesno|{{{paren|{{{p|yes}}}}}}}}|yes|(}}<!-- -->{{#if: {{{2|}}}<!-- -->|{{#if: {{{3|}}}<!-- -->|{{time ago|{{{1}}}-{{{2}}}-{{{3}}}}}<!-- -->|{{years or months ago|{{{1}}}|{{#time:n|1-{{{2}}}-1}}}}<!-- -->}}<!-- -->|{{#iferror:{{#expr:{{{1}}}}}<!-- -->|{{time ago|{{{1}}}}}<!-- -->|{{years or months ago|{{{1}}}}}<!-- -->}}<!-- -->}}<!-- -->{{#ifeq:{{yesno|{{{paren|{{{p|yes}}}}}}}}|yes|)}}</span><!-- -->|'''{{color|red|エラー: 第1パラメータの入力がありません。}}'''<!-- -->}}<!-- IMPLEMENTATION OF microformat date classes --><span style="display:none">&#160;(<span class="{{#ifeq:{{yesno|{{{end|no}}}}}|yes|dtend|bday dtstart published updated}}"><!-- -->{{#if: {{{1|}}}<!-- -->|{{{1}}}<!-- -->{{#if: {{{2|}}}<!-- -->| -{{#time:m|1-{{{2}}}-1}}<!-- -->{{#if: {{{3|}}}<!-- -->| -{{padleft:{{{3}}}|2|0}}<!-- -->}}<!-- -->}}<!-- -->}}<!-- --></span>)</span></includeonly><noinclude>{{Documentation}}</noinclude> 2319cef95fb9e114f0a232a9dbbd25211aef64d0 テンプレート:Time ago 10 72 157 156 2024-02-09T10:36:53Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{#invoke:TimeAgo|main}}<noinclude> {{documentation}} <!-- Categories go in the /doc subpage and interwikis go in Wikidata. --> </noinclude> d2cffab74ae19a4214c4828401118edd5e86ed0e モジュール:TimeAgo 828 73 159 158 2024-02-09T10:36:53Z Kyushujin 2 1版 をインポートしました Scribunto text/plain -- Implement [[Template:Time ago]] local numberSpell, yesno -- lazy load function numberSpell(arg) numberSpell = require('Module:NumberSpell')._main return numberSpell(arg) end function yesno(arg) yesno = require('Module:Yesno') return yesno(arg) end local p = {} -- Table to convert entered text values to numeric values. local timeText = { ['seconds'] = 1, ['minutes'] = 60, ['hours'] = 3600, ['days'] = 86400, ['weeks'] = 604800, ['months'] = 2629800, -- 365.25 * 24 * 60 * 60 / 12 ['years'] = 31557600 } -- Table containing tables of possible units to use in output. local timeUnits = { [1] = { '秒', '秒', "秒", "秒" }, [60] = { '分', '分', "分", "分" }, [3600] = { '時間', '時間', "時間", "時間" }, [86400] = { '日', '日', "日", "日" }, [604800] = { '週間', '週間', "週間", "週間" }, [2629800] = { 'か月', 'か月', "か月", "か月" }, [31557600] = { '年', '年', "年", "年" } } function p._main( args ) -- Initialize variables local lang = mw.language.getContentLanguage() local auto_magnitude_num local min_magnitude_num local magnitude = args.magnitude local min_magnitude = args.min_magnitude local purge = args.purge -- Add a purge link if something (usually "yes") is entered into the purge parameter if purge then purge = ' <span class="plainlinks">([' .. mw.title.getCurrentTitle():fullUrl('action=purge') .. ' キャッシュを破棄])</span>' else purge = '' end -- Check that the entered timestamp is valid. If it isn't, then give an error message. local success, inputTime = pcall( lang.formatDate, lang, 'xnU', args[1] ) if not success then return '<strong class="error">エラー: 最初のパラメータを日付や時間として解析することができません。</strong>' end -- Store the difference between the current time and the inputted time, as well as its absolute value. local timeDiff = lang:formatDate( 'xnU' ) - inputTime local absTimeDiff = math.abs( timeDiff ) if magnitude then auto_magnitude_num = 0 min_magnitude_num = timeText[magnitude] else -- Calculate the appropriate unit of time if it was not specified as an argument. local autoMagnitudeData = { { factor = 2, amn = 31557600 }, { factor = 2, amn = 2629800 }, { factor = 2, amn = 86400 }, { factor = 2, amn = 3600 }, { factor = 2, amn = 60 } } for _, t in ipairs( autoMagnitudeData ) do if absTimeDiff / t.amn >= t.factor then auto_magnitude_num = t.amn break end end auto_magnitude_num = auto_magnitude_num or 1 if min_magnitude then min_magnitude_num = timeText[min_magnitude] else min_magnitude_num = -1 end end if not min_magnitude_num then -- Default to seconds if an invalid magnitude is entered. min_magnitude_num = 1 end local result_num local magnitude_num = math.max( min_magnitude_num, auto_magnitude_num ) local unit = timeUnits[magnitude_num].unit if unit and absTimeDiff >= 864000 then local Date = require('Module:Date2')._Date local input = lang:formatDate('Y-m-d H:i:s', args[1]) -- Date needs a clean date input = Date(input) if input then local id if input.hour == 0 and input.minute == 0 then id = 'currentdate' else id = 'currentdatetime' end result_num = (Date(id) - input):age(unit) end end result_num = result_num or math.floor ( absTimeDiff / magnitude_num ) local punctuation_key, suffix if timeDiff >= 0 then -- Past if result_num == 1 then punctuation_key = 1 else punctuation_key = 2 end if args.ago == '' then suffix = '' else suffix = '' .. (args.ago or '前') end else -- Future if args.ago == '' then suffix = '後' if result_num == 1 then punctuation_key = 1 else punctuation_key = 2 end else suffix = '後' if result_num == 1 then punctuation_key = 3 else punctuation_key = 4 end end end local result_unit = timeUnits[ magnitude_num ][ punctuation_key ] -- Convert numerals to words if appropriate. local spell_out = args.spellout local spell_out_max = tonumber(args.spelloutmax) local result_num_text if spell_out and ( ( spell_out == 'auto' and 1 <= result_num and result_num <= 9 and result_num <= ( spell_out_max or 9 ) ) or ( yesno( spell_out ) and 1 <= result_num and result_num <= 100 and result_num <= ( spell_out_max or 100 ) ) ) then result_num_text = numberSpell( result_num ) else result_num_text = tostring( result_num ) end local result = result_num_text .. '' .. result_unit .. suffix -- Spaces for suffix have been added in earlier. return result .. purge end function p.main( frame ) local args = require( 'Module:Arguments' ).getArgs( frame, { valueFunc = function( k, v ) if v then v = v:match( '^%s*(.-)%s*$' ) -- Trim whitespace. if k == 'ago' or v ~= '' then return v end end return nil end, wrappers = 'Template:Time ago' }) return p._main( args ) end return p 54f948e98c477249dd70530e79f29f38a8eddd79 テンプレート:Color box 10 74 161 160 2024-02-09T10:36:53Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <templatestyles src="Legend/styles.css" /><!-- --><span class="legend-color" style="<!-- -->{{#if:{{{1|}}}|{{greater color contrast ratio|{{{1}}}|black|white|css=y}}}}<!-- -->{{#if:{{{3|}}}|color:{{{3}}};}}<!-- -->{{#if:{{{border|}}}|border:1px solid {{{border}}};}}<!-- -->"><!-- -->{{#if:{{{2|}}}|&nbsp;{{{2}}}&nbsp;|&nbsp;}}</span><!-- --><noinclude>{{Documentation}}</noinclude> 10bc4f11ef1eb3da75caa24583999480efb28189 テンプレート:Legend/styles.css 10 75 163 162 2024-02-09T10:36:54Z Kyushujin 2 1版 をインポートしました text text/plain /* {{pp-template}} */ .legend { page-break-inside: avoid; break-inside: avoid-column; } .legend-color { display: inline-block; min-width: 1.5em; height: 1.5em; /* line-height: 1.5; */ margin: 1px 0; text-align: center; border: 1px solid black; background-color: transparent; color: black; } .legend-text {/*empty for now, but part of the design!*/} /* [[Category:テンプレートスタイル]] */ 5573ced404bda54aab5da4ded375d2d94bf19fa2 テンプレート:Draw 10 76 165 164 2024-02-09T10:36:54Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <noinclude>{| class="wikitable" |- |</noinclude>style="background:#c5d2ea; color:black; vertical-align:middle; text-align:{{{align|center}}}; {{{style|}}}" class="table-draw" |{{{1|}}}<noinclude> |} {{Documentation|Template:Table cell templates}} </noinclude> abb380cae60944a305fc60fb3f4e1d006a534832 テンプレート:複雑なテンプレート 10 77 167 166 2024-02-09T10:36:54Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{ombox | type = style | image = [[File:Nuvola apps important yellow.svg|40x40px]] | text = このテンプレートの記述は複雑な構成となっています。編集後の結果が予想できないか、または変更にともなう影響を修正する用意ができていない場合は編集をお控えください。練習や実験は{{ #switch:{{NAMESPACE}} |モジュール=モジュール |#default=テンプレート }}の[[{{ #switch: {{SUBPAGENAME}} | doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}} | #default = {{SUBJECTPAGENAME}} }}/sandbox|サンドボックス・サブページ]]、[[{{ #switch: {{SUBPAGENAME}} | doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}} | #default = {{SUBJECTPAGENAME}} }}/testcases|テストケース・サブページ]]{{ #switch:{{NAMESPACE}} |モジュール= |#default=もしくはあなた自身の[[Wikipedia:利用者ページ|利用者スペース]]の[[特別:Mypage/sandbox|ページ]] }}でお願いします。}}<includeonly>{{ #switch: {{SUBPAGENAME}} | doc = | sandbox = | testcases = | {{ #switch: {{NAMESPACE}} | Template = [[Category:複雑なテンプレート{{#if: {{{1|}}} | {{!}}{{{1}}} }}]] }} }}</includeonly><noinclude> {{Documentation}} </noinclude> 61271f7c8b463f987d055974eef92031954f6ef0 テンプレート:World 10 78 169 168 2024-02-09T10:36:55Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki {{Flagicon|World}} [[世界]]<noinclude> [[Category:各国の国旗と国名テンプレート|World]] </noinclude> 2e8f6333d4065c7730bc80cfef0584f85da6051a テンプレート:Infobox 鉄道路線/doc 10 79 171 170 2024-02-09T10:36:57Z Kyushujin 2 1版 をインポートしました wikitext text/x-wiki <noinclude>{{Documentation subpage}}</noinclude>{{Sandbox other||{{使用箇所の多いテンプレート|1,900以上}}{{複雑なテンプレート}}}} [[鉄道路線]]の情報を表示する基礎情報テンプレートです。英語版から翻案された[[Template:Infobox rail line]]とは異なり、引数の日本語化や日本語版での需要に合わせ項目を調整しています。 == 使い方 == {{See also|[[#使用例]]}} 項目は全て省略可能。不明な情報は空白のままで構いません。基本項目の雛形をベースに必要に応じて全項目の中から選び出すことで、未入力項目による記事の容量増加を最小限に抑えられます。 *全引数一覧 <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名 = |路線色 = #000000 |路線色2 = #000000 |ロゴ = <!-- ロゴ.svg --> |ロゴサイズ = <!--px--> |画像 = <!-- 画像.jpg --> |画像サイズ = <!--px--> |画像説明 = |通称 = |現況 = |国 = |所在地 = |種類 = |路線網 = |区間 = |起点 = [[駅]] |終点 = [[駅]] |駅数 = 駅 |停留場数 = 停留場 |停留所数 = 停留所 |経由路線 = |輸送実績 = |1日利用者数 = |電報略号 = |路線記号 = |路線番号 = |路線色3 = |開業 = |項目1 = |日付1 = |項目2 = |日付2 = |項目3 = |日付3 = |最終延伸 = |全通 = |休止 = |廃止 = |再開 = |所有者 = |運営者 = |運転指令所 = |車両基地 = |使用車両 = |路線構造 = |路線距離 = km |営業キロ = km |軌間 = mm |線路数 = |複線区間 = |電化区間 = |電化方式 = |車両限界 = |最大勾配 = ‰ |最小曲線半径 = m |高低差 = m |閉塞方式 = |保安装置 = |ラック方式 = |最高速度 = km/h |駅間平均長 = |諸元備考 = |諸元備考内容 = |路線図 = |路線図名 = |路線図表示 = <!--collapsed--> }} </pre> == 引数解説・機能比較 == このテンプレートで表示可能な機能、および[[Template:Infobox rail line]]との機能比較は以下の通りです。テンプレートの移行や各言語版間の翻訳時に参考にしてください。 {| class="wikitable" style="font-size:90%" |- !colspan="2" |引数<!--順序はInfobox 鉄道路線準拠--> !colspan="2" |ラベル名 !rowspan="2" |Infobox 鉄道路線における定義<br />(Infobox 鉄道路線にない引数はInfobox rail lineの定義) |- !style="white-space:nowrap"|[[Template:Infobox rail line|rail line]] !style="white-space:nowrap"|[[Template:Infobox 鉄道路線|鉄道路線]] !style="white-space:nowrap"|rail line !style="white-space:nowrap"|鉄道路線 |- | <code>box_width</code> || {{n/a}} || || {{n/a}} || Infoboxの幅を指定(Infobox 鉄道路線では300pxで固定)。 |- |- | <code>name</code> || <code>路線名</code> || || || 路線名。デフォルト設定は記事名。 |- | <code>color</code> || <code>路線色</code> || || || 路線の色を指定。[[ウェブカラー#16進トリプレット表記|6桁]]で色を表す場合は頭の "#" '''付き'''で入力。 |- | <code>color2</code> || <code>路線色2</code> || || || 第二の色を指定(Infobox 鉄道路線では指定しなくても上下のラインカラーの帯が揃う)。 |- | <code>logo</code><br /><code>logo2</code> || <code>ロゴ</code> || || || ロゴを路線名の下に配置('''1つのみ'''表示可能)。冒頭の「ファイル:」は省略。 |- | <code>logo_width</code><br /><code>logo_width2</code> || <code>ロゴサイズ</code> || || || ロゴの横幅を指定。デフォルト設定は'''90px'''。 |- | <code>logo_alt</code><br /><code>logo_alt2</code> || {{n/a}} || || {{n/a}} || ロゴマークの代替テキスト(Infobox 鉄道路線では「シンボルマーク」で固定)。 |- | <code>image</code> || <code>画像</code> || || || 画像のファイル名を入力。冒頭の「ファイル:」は省略。 |- | <code>image_width</code> || <code>画像サイズ</code> || || || 画像の横幅を指定。デフォルト設定は'''300px'''。 |- | <code>image_alt</code> || {{n/a}} || || {{n/a}} || 画像の代替テキスト(Infobox 鉄道路線では「画像説明」と同じ内容が表示される)。 |- | <code>caption</code> || <code>画像説明</code> || || || 画像の説明。 |- ! colspan="5" | 概要・運営 / 基本情報 |- | <code>other_name</code> || <code>通称</code> || 通称 || 通称 || 路線の通称。 |- | <code>native_name</code> || {{n/a}} || 現地表記 || {{n/a}} || 路線の現地語表記(海外の鉄道など)。 |- | <code>native_name_lang</code> || {{n/a}} || || {{n/a}} || 現地語の種類。[[ISO 639-2コード一覧|ISO 639-2コード]]に準じる。言語を複数表記する場合は {{tl|lang}} を使う。 |- | <code>status</code> || <code>現況</code> || 現況 || 現況 || 路線の現況(計画中、工事中、廃止、未成など。現役路線では使用しない)。 |- | {{n/a}} || <code>国</code> || {{n/a}} || 国 || 路線が所在する国や地域。[[Wikipedia:Template国名3レターコード]]利用を想定。 |- | <code>locale</code> || <code>所在地</code> || 所在地 || 所在地 || 路線が通る地域名・自治体名(路線規模によって適宜簡潔にまとめる)。<br/>都道府県旗や地方旗の画像は挿入しない(詳しくは[[プロジェクト:鉄道#アイコン画像によるマークアップ]]を参照。「routes」「owner」「operator」の記述も、このガイドラインによるものです)。 |- | <code>coordinates</code> || {{n/a}} || 座標 || {{n/a}} || 路線の緯度と経度。{{Tl|Coord}}を使用。 |- | <code>type</code> || <code>種類</code> || 種別 || 種類 || 鉄道の類型([[高速鉄道]]、[[路面電車]]、[[モノレール]]など) |- | <code>system</code> || <code>路線網</code> || 系統 || 路線網 || 路線が属する路線網や系統、システム名。 |- | {{n/a}} || <code>区間</code> || {{n/a}} || 区間 || |- | <code>start</code> || <code>起点</code> || rowspan="2" style="vertical-align:top" | 起終点 || 起点 || 路線の起点駅や地域名。 |- | <code>end</code> || <code>終点</code> || 終点 || 路線の終点駅や地域名。 |- | <code>stations</code> || <code>駅数</code> || 駅数 || 駅数 || 駅の数(特記なければは起終点駅を含む)。 |- | {{n/a}} || <code>停留場数</code> || {{n/a}} || 停留場数 || 停留場の数(同上)。 |- | {{n/a}} || <code>停留所数</code> || {{n/a}} || 停留所数 || 停留所の数(同上)。 |- | <code>continuesfrom</code><br /><code>continuesas</code><br /><code>connectinglines</code><br /> || {{n/a}} || 接続路線 || {{n/a}} || 当該路線に接続する路線。 |- | <code>routes</code> || <code>経由路線</code><br /><code>構成路線</code> || 路線 || 経由路線 || 経由する線籍上の路線名称を記入([[運転系統]]向け)。<br/>路線シンボルマーク等の画像は挿入しない。 |- | <code>ridership2</code> || <code>輸送実績</code> || 乗客数 || 輸送実績 || 年単位等の輸送実績が公表されている場合に記入。 |- | <code>ridership</code> || <code>1日利用者数</code> || 1日の乗客数 || 1日利用者数 || 1日利用者数が公表されている場合に記入。 |- | {{n/a}} || <code>電報略号</code> || {{n/a}} || 電報略号 || 路線の[[電報略号 (鉄道)|電報略号]]。 |- | <code>trainnumber</code> || {{n/a}} || 列車番号 || {{n/a}} || チケットや時刻表に記入される列車番号。 |- | <code>linenumber</code> || <code>路線記号</code> || 路線記号 || 路線記号 || 路線記号。 |- | <code>routenumber</code> || <code>路線番号</code> || ルート番号 || 路線番号 || 路線番号(Infobox rail lineでは「路線諸元」に位置する)。 |- | <code>mapcolour</code><br /><code>mapcolor</code> || <code>路線色3</code> || 路線カラー || 路線色 || 路線色を冒頭の帯とは別に記載する場合に記入。 |- | <code>mapcolourlink</code><br /><code>mapcolorlink</code> || {{n/a}} || || {{n/a}} || 路線色のリンク先がある場合に記入。 |- | <code>website</code> || {{draw|提案中}} || ウェブサイト || {{draw|ウェブサイト}} || 路線の外部リンク(公式サイト等)を表示。 |- | <code>open</code> || <code>開業</code> || 開業 || 開業 || 路線が最初に開業した年月日。 |- | <code>event1</code><br /><code>event2</code><br /><code>event3</code><br /> || <code>日付1</code><br /><code>日付2</code><br /><code>日付3</code> ||<code>event1label</code><br /><code>event2label</code><br /><code>event3label</code> || <code>項目1</code><br /><code>項目2</code><br /><code>項目3</code> || 路線の延長、短縮、移管などの変遷日を任意のラベル名で記載。<br />"<code>項目1=</code>"のラベル名に対応した日付を"<code>日付1=</code>"に記入。3つまで設定可能。 |- | <code>lastextension</code> || <code>最終延伸</code> || 最終延伸 || 最終延伸 || 計画、工事路線が現段階で延伸した期日。 |- | {{draw|提案中}} || <code>全通</code> || {{draw|全通}} || 全通 || 予定された全区間が開業した期日。 |- | {{n/a}} || <code>休止</code> || {{n/a}} || 休止 || 路線が休止した年月日。 |- | <code>close</code> || <code>廃止</code> || 廃止 || 廃止 || 路線が廃止された年月日。 |- | <code>reopen</code> || <code>再開</code> || 再開 || 再開 || 休廃止後に再び開業した年月日。 |- | <code>owner</code> || <code>所有者</code> || 所有者 || 所有者 || 運営者と異なる所有者が存在する場合に記入(第一種、第三種鉄道事業に相当)。<br/>企業ロゴ等の画像は挿入しない。 |- | <code>operator</code> || <code>運営者</code><br /><code>運行者</code> || 運営者 || 運営者 || 路線を運営している事業者を記入(第一種、第二種鉄道事業に相当)。<br/>企業ロゴ等の画像は挿入しない。 |- | <code>conductionsystem</code> || {{n/a}} || 運行方法 || {{n/a}} || 路線の運行方法。 |- | <code>character</code> || <code>路線構造</code> || 路線構造 || 路線構造 || 路線の構造(高架など)。都市鉄道向け。 |- | {{n/a}} || <code>運転指令所</code> || {{n/a}} || 運転指令所 || 路線の運転指令所。 |- | <code>depot</code> || <code>車両基地</code> || 車両基地 || 車両基地 || 路線の車両基地や車庫。 |- | <code>stock</code> || <code>使用車両</code> || 使用車両 || 使用車両 || 路線で使われている車両(種類が多岐にわたる場合は使用しない)。 |- ! colspan="5" |路線諸元 |- | <code>linelength</code><br /><code>linelength_footnotes</code> || <code>路線距離</code><br /><code>総延長</code> || rowspan="3" | 路線総延長 || rowspan="3" | 路線距離 || 路線の総延長。キロメートル ([[キロメートル|km]]) で記載(要記号)。 |- | <code>linelength_km</code> || {{n/a}} || キロメートル→[[マイル]]自動変換機能。記号なしでキロメートル入力。 |- | <code>linelength_mi</code> || {{n/a}} || マイル→キロメートル自動変換機能。記号なしでマイル入力。 |- | <code>tracklength</code><br /><code>tracklength_footnotes</code> || {{n/a}} || rowspan="3" | 線路総延長 || {{n/a}} || 線路の総延長(例えば複線ならそれぞれの単線の長さを合算)。キロメートル (km) で記載(要記号)。 |- | <code>tracklength_km</code> || {{n/a}} || {{n/a}} || キロメートル→マイル自動変換機能。記号なしでキロメートル入力。 |- | <code>tracklength_mi</code> || {{n/a}} || {{n/a}} || マイル→キロメートル自動変換機能。記号なしでマイル入力。 |- | {{n/a}} || <code>営業キロ</code> || {{n/a}} || 営業キロ || [[営業キロ]]。 |- | <code>gauge</code> || <code>軌間</code> || 軌間 || 軌間 || 路線の[[軌間]]を記入。ミリメートル ([[ミリメートル|mm]]) で記載(要記号)。[[狭軌]]、[[標準軌]]、[[広軌]]といった補記は適宜手動入力。 |- | <code>ogauge</code> || {{n/a}} || 過去の軌間 || {{n/a}} || [[改軌]]前の軌間を記入。 |- | <code>notrack</code> || <code>線路数</code> || 路線数 || 線路数 || 単線、複線など路線上の線路数を記入。 |- | {{n/a}} || <code>複線区間</code> || {{n/a}} || 複線区間 || 複線区間。 |- | {{n/a}} || <code>電化区間</code> || {{n/a}} || 電化区間 || [[鉄道の電化|電化]]区間。 |- | <code>el</code> || <code>電化方式</code> || 電化 || 電化方式 || 路線の電圧や電化形式([[第三軌条方式]]、[[架空電車線方式]]等)。 |- | <code>lgauge</code> || <code>車両限界</code> || 車両限界 || 車両限界 || 路線の[[車両限界]]。 |- | <code>maxincline</code> || <code>最大勾配</code> || 最急勾配 || 最大勾配 || 路線の最急勾配。パーミル ([[パーミル|‰]]) で記載(要記号)。 |- | <code>minradius</code> || style="white-space:nowrap"| <code>最小曲線半径</code> || rowspan="3" | 最小曲線半径 || rowspan="3" style="white-space:nowrap"| 最小曲線半径 || 路線の最小曲線半径。メートル ([[メートル|m]]) で記載(要記号)。 |- | <code>minradius_m</code> || {{n/a}} || メートル→[[フィート]]自動変換機能。記号なしでメートル入力。 |- | <code>minradius_ft</code> || {{n/a}} || フィート→メートル自動変換機能。記号なしでフィート入力。 |- | <code>elevation</code> || {{n/a}} || rowspan="3" | 最高地点 || {{n/a}} || 路線の最標高地点。メートル (m) で記載(要記号)。 |- | <code>elevation_m</code> || {{n/a}} || {{n/a}} || メートル→フィート自動変換機能。記号なしでメートル入力。 |- | <code>elevation_ft</code> || {{n/a}} || {{n/a}} || フィート→メートル自動変換機能。記号なしでフィート入力。 |- | {{n/a}} || <code>高低差</code> || {{n/a}} || 高低差 || 路線の標高差([[登山鉄道]]等で使用)。メートル (m) で記載(要記号)。 |- | {{n/a}} || <code>閉塞方式</code> || {{n/a}} || 閉塞方式 || 路線の[[閉塞 (鉄道)|閉塞方式]]。 |- | {{n/a}} || <code>保安装置</code> || {{n/a}} || 保安装置 || 路線の[[自動列車保安装置|保安装置]]。 |- | <code>racksystem</code> || <code>ラック方式</code> || ラック方式 || ラック方式 || [[ラック式鉄道]]の方式を記入(例:[[アプト式]])。 |- | <code>ra</code> || {{n/a}} || RA || {{n/a}} || [[:en:Route availability]]。イギリスの線路規格。 |- | <code>speed</code> || <code>最高速度</code> || rowspan="3" | 運行速度 || rowspan="3" | 最高速度 || 路線の速度(最高速度)。キロメートル毎時 ([[キロメートル毎時|km/h]]) で記載(要記号)。 |- | <code>speed_km/h</code> || {{n/a}} || キロメートル毎時→[[マイル毎時]]自動変換機能。記号なしでキロメートル毎時入力。 |- | <code>speed_mph</code> || {{n/a}} || マイル毎時→キロメートル自動変換機能。記号なしでマイル毎時入力。 |- | <code>aveinterstation</code> || <code>駅間平均長</code> || 駅間平均長 || 駅間平均長 || 駅間平均距離。キロメートル (km) で記載(要記号)。 |- | {{n/a}} || <code>諸元備考内容</code> || {{n/a}} || <code>諸元備考</code> || 諸元に関する上記項目にない要素を盛り込む際に使用。<br />"<code>諸元備考=</code>"のラベル名(追加要素)に対応した内容を"<code>諸元備考内容=</code>"に記入。 |- ! colspan="5" |路線図 |- | <code>map</code> || <code>路線図</code> || || || 路線図を表示。 |- | <code>map_name</code> || <code>路線図名</code> || || || 図の上部にある「路線図」の名称を変更可能。 |- | <code>map_state</code> || <code>路線図表示</code> || || || <code>collapsed</code>と入力することでデフォルトで図を折り畳む。 |- |} == 例 == {{Infobox 鉄道路線 |路線名=A線 |路線色=#FF0000<!--赤--> |路線色2=#0000FF<!--青--> |ロゴ= |ロゴサイズ=50px<!--デフォルトサイズ--> |画像=Information example page2 300px.jpg |画像サイズ=250px<!--デフォルトサイズ--> |画像説明=表示例 |通称=エー線 |現況=休止 |国={{World}} |所在地=世界 |種類=[[高速鉄道]] |路線網=地球路線網 |起点=A駅 |終点=z停留所 |駅数=26駅 |停留場数=26停留場 |停留所数=26停留所 |経由路線=A本線、B支線、C連絡線 |輸送実績=3,650,000 (1950年) |1日利用者数=10,000 (1950年) |電報略号=エエ |路線記号=A |路線番号=1 |路線色3={{Color box|#008000}}<!--緑--> |開業=1910年1月1日 |項目1=国有化 |日付1=1920年2月2日 |項目2=民営化 |日付2=1930年3月3日 |項目3=区間縮小 |日付3=1940年4月4日 |最終延伸=1950年5月5日 |全通= |休止=1960年6月6日 |廃止= |再開= |所有者=地球 |運営者=人類 |車両基地=南極 |使用車両=[[#車両|車両]]を参照 |路線構造=高架 |路線距離=2,000km |営業キロ=1,500km |軌間=1,435 mm ([[標準軌]]) |線路数=[[単線]] |複線区間=A駅 - a停留場間 |電化区間=z停留場 - z停留所間 |電化方式=[[架空電車線方式]] |最大勾配=50‰ |最小曲線半径=500m |高低差=1,000m |閉塞方式=スタフ閉塞式 |保安装置=[[自動列車制御装置|ATC]] |ラック方式=マーシュ式 |最高速度=100km/h |路線図=Example.svg |路線図名=A線路線図 |路線図表示=collapsed }} <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名=A線 |路線色=#FF0000<!--赤--> |路線色2=#0000FF<!--青--> |ロゴ= |ロゴサイズ=50px<!--デフォルトサイズ--> |画像=Information example page2 300px.jpg |画像サイズ=250px<!--デフォルトサイズ--> |画像説明=表示例 |通称=エー線 |現況=休止 |国={{World}} |所在地=世界 |種類=[[高速鉄道]] |路線網=地球路線網 |起点=A駅 |終点=z停留所 |駅数=26駅 |停留場数=26停留場 |停留所数=26停留所 |経由路線=A本線、B支線、C連絡線 |輸送実績=3,650,000 (1950年) |1日利用者数=10,000 (1950年) |電報略号=エエ |路線記号=A |路線番号=1 |路線色3={{Color box|#008000}}<!--緑--> |開業=1910年1月1日 |項目1=国有化 |日付1=1920年2月2日 |項目2=民営化 |日付2=1930年3月3日 |項目3=区間縮小 |日付3=1940年4月4日 |最終延伸=1950年5月5日 |全通= |休止=1960年6月6日 |廃止= |再開= |所有者=地球 |運営者=人類 |車両基地=南極 |使用車両=[[#車両|車両]]を参照 |路線構造=高架 |路線距離=2,000km |営業キロ=1,500km |軌間=1,435 mm ([[標準軌]]) |線路数=[[単線]] |複線区間=A駅 - a停留場間 |電化区間=z停留場 - z停留所間 |電化方式=[[架空電車線方式]] |最大勾配=50‰ |最小曲線半径=500m |高低差=1,000m |閉塞方式=スタフ閉塞式 |保安装置=[[自動列車制御装置|ATC]] |ラック方式=マーシュ式 |最高速度=100km/h |路線図=Example.svg |路線図名=A線路線図 |路線図表示=collapsed }} </pre> == 使用例 == === 例1 === * [[山陽新幹線]] {{Infobox 鉄道路線 |路線名=[[File:JR logo (west).svg|35px|link=西日本旅客鉄道]] 山陽新幹線 |画像=JRW N700-7000series S1.jpg |画像サイズ=300px |画像説明=主に「さくら」で運転されているN700系7000番台 |国={{JPN}} |所在地=[[大阪府]]、[[兵庫県]]、[[岡山県]]、[[広島県]]、[[山口県]]、[[福岡県]] |種類=[[高速鉄道]]([[新幹線]]) |起点=[[新大阪駅]] |終点=[[博多駅]] |駅数=19駅 |開業=[[1972年]][[3月15日]] (新大阪駅-[[岡山駅]])<br />[[1975年]][[3月10日]] (岡山駅-博多駅) |所有者=[[西日本旅客鉄道]](JR西日本) |運営者=西日本旅客鉄道(JR西日本) |車両基地=[[博多総合車両所]] |路線距離=557.3 [[キロメートル|km]] |営業キロ=644.0 km |線路数=[[複線]] |軌間=1,435 [[ミリメートル|mm]] ([[標準軌]]) |電化方式=交流25,000[[ボルト (単位)|V]]・60[[ヘルツ|Hz]] [[架空電車線方式]] |最大勾配=15 [[パーミル|‰]] |最小曲線半径=4,000 [[メートル|m]] |閉塞方式=車内信号式 |保安装置=[[自動列車制御装置#ATC-1型(東海道・山陽型)|ATC-1W]]および[[自動列車制御装置#ATC-NS|ATC-NS]]([[新幹線700系電車|700系]]7000番台以外の車両における新大阪駅構内のみ) |最高速度=300 [[キロメートル毎時|km/h]] }} <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名=[[File:JR logo (west).svg|35px|link=西日本旅客鉄道]] 山陽新幹線 |画像=JRW N700-7000series S1.jpg |画像サイズ=300px |画像説明=主に「さくら」で運転されているN700系7000番台 |国={{JPN}} |所在地=[[大阪府]]、[[兵庫県]]、[[岡山県]]、[[広島県]]、[[山口県]]、[[福岡県]] |種類=[[高速鉄道]]([[新幹線]]) |起点=[[新大阪駅]] |終点=[[博多駅]] |駅数=19駅 |開業=[[1972年]][[3月15日]] (新大阪駅-[[岡山駅]])<br />[[1975年]][[3月10日]] (岡山駅-博多駅) |所有者=[[西日本旅客鉄道]](JR西日本) |運営者=西日本旅客鉄道(JR西日本) |車両基地=[[博多総合車両所]] |路線距離=557.3 [[キロメートル|km]] |営業キロ=644.0 km |線路数=[[複線]] |軌間=1,435 [[ミリメートル|mm]] ([[標準軌]]) |電化方式=交流25,000[[ボルト (単位)|V]]・60[[ヘルツ|Hz]] [[架空電車線方式]] |最大勾配=15 [[パーミル|‰]] |最小曲線半径=4,000 [[メートル|m]] |閉塞方式=車内信号式 |保安装置=[[自動列車制御装置#ATC-1型(東海道・山陽型)|ATC-1W]]および[[自動列車制御装置#ATC-NS|ATC-NS]]([[新幹線700系電車|700系]]7000番台以外の車両における新大阪駅構内のみ) |最高速度=300 [[キロメートル毎時|km/h]] }} </pre> === 例2 === * [[京浜東北線]] {{Infobox 鉄道路線 |路線名=[[File:JR logo (east).svg|35px|link=東日本旅客鉃道]] 京浜東北線 |路線色=#00b2e5 |ロゴ=JR JK line symbol.svg |ロゴサイズ=40px |画像=Series-E233-1000-113.jpg |画像サイズ=300px |画像説明=主力車両の[[JR東日本E233系電車|E233系1000番台]]<br>(2021年3月 さいたま新都心駅) |国={{JPN}} |所在地=[[埼玉県]]、[[東京都]]、[[神奈川県]] |種類=[[日本の鉄道|普通鉄道]]([[在来線]]・[[幹線]]) |区間=[[大宮駅 (埼玉県)|大宮駅]] - [[横浜駅]]間 |駅数=36駅 |電報略号=トホホセ(大宮 - 東京間)<br>トカホセ(東京 - 横浜間) |路線記号=JK |経由路線=[[東北本線]]、[[東海道本線]] |開業={{Start date and age|1914|12|20}} |廃止= |所有者=[[東日本旅客鉄道]](JR東日本) |運営者=東日本旅客鉄道(JR東日本) |車両基地=[[さいたま車両センター]] |使用車両=[[JR東日本E233系電車|E233系1000番台]] 10両 |路線距離=59.1 km |軌間=1,067 [[ミリメートル|mm]] |線路数=[[複線]] |電化方式=[[直流電化|直流]]1,500 [[ボルト (単位)|V]] [[架空電車線方式]] |最高速度=90 [[キロメートル毎時|km/h]] }} <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名=[[File:JR logo (east).svg|35px|link=東日本旅客鉃道]] 京浜東北線 |路線色=#00b2e5 |ロゴ=JR JK line symbol.svg |ロゴサイズ=40px |画像=Series-E233-1000-113.jpg |画像サイズ=300px |画像説明=主力車両の[[JR東日本E233系電車|E233系1000番台]]<br>(2021年3月 さいたま新都心駅) |国={{JPN}} |所在地=[[埼玉県]]、[[東京都]]、[[神奈川県]] |種類=[[日本の鉄道|普通鉄道]]([[在来線]]・[[幹線]]) |区間=[[大宮駅 (埼玉県)|大宮駅]] - [[横浜駅]]間 |駅数=36駅 |電報略号=トホホセ(大宮 - 東京間)<br>トカホセ(東京 - 横浜間) |路線記号=JK |経由路線=[[東北本線]]、[[東海道本線]] |開業={{Start date and age|1914|12|20}} |廃止= |所有者=[[東日本旅客鉄道]](JR東日本) |運営者=東日本旅客鉄道(JR東日本) |車両基地=[[さいたま車両センター]] |使用車両=[[JR東日本E233系電車|E233系1000番台]] 10両 |路線距離=59.1 km |軌間=1,067 [[ミリメートル|mm]] |線路数=[[複線]] |電化方式=[[直流電化|直流]]1,500 [[ボルト (単位)|V]] [[架空電車線方式]] |最高速度=90 [[キロメートル毎時|km/h]] }} </pre> === 例3 === * [[中央線快速]] {{Infobox 鉄道路線 |路線名=[[File:JR logo (east).svg|35px|東日本旅客鉄道|link=東日本旅客鉄道]] 中央線快速 |路線色=#f15a22 |ロゴ=JR JC line symbol.svg |ロゴサイズ=40px |画像=Series209-1000 E233-130th.jpg |画像サイズ=300px |画像説明=中央線快速の車両[[JR東日本209系電車|209系]](左)と[[JR東日本E233系電車|E233系]](右)<br />(2019年6月29日 [[西国分寺駅]]) |国={{JPN}} |所在地=[[東京都]] |種類=[[通勤列車]] |起点=[[東京駅]] |終点=[[高尾駅 (東京都)|高尾駅]] |駅数=24駅 |電報略号=チウホセ |路線記号=JC |経由路線=[[東北本線]](東京 - 神田間)<br>[[中央本線]](神田 - 代々木間、新宿 - 高尾間)<br>[[山手線]](代々木 - 新宿間) |開業={{Start date and age|1889|4|11}} |廃止= |所有者=[[東日本旅客鉄道]](JR東日本) |運営者=東日本旅客鉄道(JR東日本) |車両基地=[[豊田車両センター]] |使用車両=[[JR東日本E233系電車#0番台|E233系0番台]]<br>[[JR東日本209系電車#1000番台|209系1000番台]] |路線距離=53.1 [[キロメートル|km]] |軌間=1,067 [[ミリメートル|mm]] |線路数=[[複線]] |電化方式=[[直流電化|直流]]1,500 [[ボルト (単位)|V]] [[架空電車線方式]] |閉塞方式=自動閉塞式 |保安装置=[[自動列車停止装置#ATS-P形(デジタル伝送パターン形)|ATS-P]] |最高速度=100 [[キロメートル毎時|km/h]]<br>130 km/h(八王子 - 高尾間の特急列車) }} <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名=[[File:JR logo (east).svg|35px|東日本旅客鉄道|link=東日本旅客鉄道]] 中央線快速 |路線色=#f15a22 |ロゴ=JR JC line symbol.svg |ロゴサイズ=40px |画像=Series209-1000 E233-130th.jpg |画像サイズ=300px |画像説明=中央線快速の車両[[JR東日本209系電車|209系]](左)と[[JR東日本E233系電車|E233系]](右)<br />(2019年6月29日 [[西国分寺駅]]) |国={{JPN}} |所在地=[[東京都]] |種類=[[通勤列車]] |起点=[[東京駅]] |終点=[[高尾駅 (東京都)|高尾駅]] |駅数=24駅 |電報略号=チウホセ |路線記号=JC |経由路線=[[東北本線]](東京 - 神田間)<br>[[中央本線]](神田 - 代々木間、新宿 - 高尾間)<br>[[山手線]](代々木 - 新宿間) |開業={{Start date and age|1889|4|11}} |廃止= |所有者=[[東日本旅客鉄道]](JR東日本) |運営者=東日本旅客鉄道(JR東日本) |車両基地=[[豊田車両センター]] |使用車両=[[JR東日本E233系電車#0番台|E233系0番台]]<br>[[JR東日本209系電車#1000番台|209系1000番台]] |路線距離=53.1 [[キロメートル|km]] |軌間=1,067 [[ミリメートル|mm]] |線路数=[[複線]] |電化方式=[[直流電化|直流]]1,500 [[ボルト (単位)|V]] [[架空電車線方式]] |閉塞方式=自動閉塞式 |保安装置=[[自動列車停止装置#ATS-P形(デジタル伝送パターン形)|ATS-P]] |最高速度=100 [[キロメートル毎時|km/h]]<br>130 km/h(八王子 - 高尾間の特急列車) }} </pre> == 関連テンプレート == * {{tl|Infobox 公共交通機関}} - 複数路線で構成されるネットワーク・システムの情報を集約する場合に用いるテンプレート。 * {{tl|BS-map}} - [[Wikipedia:経路図テンプレート|経路図]]を入力するテンプレート。 <includeonly> {{DEFAULTSORT:Infobox てつとうろせん}} [[Category:鉄道の基礎情報テンプレート|ろせん]] </includeonly> 982825136037a2f57e0b5573c99a2eb6fbade1ab 179 171 2024-02-09T15:40:40Z Kyushujin 2 /* 使い方 */ wikitext text/x-wiki <noinclude>{{Documentation subpage}}</noinclude>{{Sandbox other||{{使用箇所の多いテンプレート|1,900以上}}{{複雑なテンプレート}}}} [[鉄道路線]]の情報を表示する基礎情報テンプレートです。英語版から翻案された[[Template:Infobox rail line]]とは異なり、引数の日本語化や日本語版での需要に合わせ項目を調整しています。 このテンプレートはWikipedia[https://ja.wikipedia.org/wiki/Template:%E9%89%84%E9%81%93%E8%B7%AF%E7%B7%9A]からお借りして使用しています == 使い方 == {{See also|[[#使用例]]}} 項目は全て省略可能。不明な情報は空白のままで構いません。基本項目の雛形をベースに必要に応じて全項目の中から選び出すことで、未入力項目による記事の容量増加を最小限に抑えられます。 *全引数一覧 <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名 = |路線色 = #000000 |路線色2 = #000000 |ロゴ = <!-- ロゴ.svg --> |ロゴサイズ = <!--px--> |画像 = <!-- 画像.jpg --> |画像サイズ = <!--px--> |画像説明 = |通称 = |現況 = |国 = |所在地 = |種類 = |路線網 = |区間 = |起点 = [[駅]] |終点 = [[駅]] |駅数 = 駅 |停留場数 = 停留場 |停留所数 = 停留所 |経由路線 = |輸送実績 = |1日利用者数 = |電報略号 = |路線記号 = |路線番号 = |路線色3 = |開業 = |項目1 = |日付1 = |項目2 = |日付2 = |項目3 = |日付3 = |最終延伸 = |全通 = |休止 = |廃止 = |再開 = |所有者 = |運営者 = |運転指令所 = |車両基地 = |使用車両 = |路線構造 = |路線距離 = km |営業キロ = km |軌間 = mm |線路数 = |複線区間 = |電化区間 = |電化方式 = |車両限界 = |最大勾配 = ‰ |最小曲線半径 = m |高低差 = m |閉塞方式 = |保安装置 = |ラック方式 = |最高速度 = km/h |駅間平均長 = |諸元備考 = |諸元備考内容 = |路線図 = |路線図名 = |路線図表示 = <!--collapsed--> }} </pre> == 引数解説・機能比較 == このテンプレートで表示可能な機能、および[[Template:Infobox rail line]]との機能比較は以下の通りです。テンプレートの移行や各言語版間の翻訳時に参考にしてください。 {| class="wikitable" style="font-size:90%" |- !colspan="2" |引数<!--順序はInfobox 鉄道路線準拠--> !colspan="2" |ラベル名 !rowspan="2" |Infobox 鉄道路線における定義<br />(Infobox 鉄道路線にない引数はInfobox rail lineの定義) |- !style="white-space:nowrap"|[[Template:Infobox rail line|rail line]] !style="white-space:nowrap"|[[Template:Infobox 鉄道路線|鉄道路線]] !style="white-space:nowrap"|rail line !style="white-space:nowrap"|鉄道路線 |- | <code>box_width</code> || {{n/a}} || || {{n/a}} || Infoboxの幅を指定(Infobox 鉄道路線では300pxで固定)。 |- |- | <code>name</code> || <code>路線名</code> || || || 路線名。デフォルト設定は記事名。 |- | <code>color</code> || <code>路線色</code> || || || 路線の色を指定。[[ウェブカラー#16進トリプレット表記|6桁]]で色を表す場合は頭の "#" '''付き'''で入力。 |- | <code>color2</code> || <code>路線色2</code> || || || 第二の色を指定(Infobox 鉄道路線では指定しなくても上下のラインカラーの帯が揃う)。 |- | <code>logo</code><br /><code>logo2</code> || <code>ロゴ</code> || || || ロゴを路線名の下に配置('''1つのみ'''表示可能)。冒頭の「ファイル:」は省略。 |- | <code>logo_width</code><br /><code>logo_width2</code> || <code>ロゴサイズ</code> || || || ロゴの横幅を指定。デフォルト設定は'''90px'''。 |- | <code>logo_alt</code><br /><code>logo_alt2</code> || {{n/a}} || || {{n/a}} || ロゴマークの代替テキスト(Infobox 鉄道路線では「シンボルマーク」で固定)。 |- | <code>image</code> || <code>画像</code> || || || 画像のファイル名を入力。冒頭の「ファイル:」は省略。 |- | <code>image_width</code> || <code>画像サイズ</code> || || || 画像の横幅を指定。デフォルト設定は'''300px'''。 |- | <code>image_alt</code> || {{n/a}} || || {{n/a}} || 画像の代替テキスト(Infobox 鉄道路線では「画像説明」と同じ内容が表示される)。 |- | <code>caption</code> || <code>画像説明</code> || || || 画像の説明。 |- ! colspan="5" | 概要・運営 / 基本情報 |- | <code>other_name</code> || <code>通称</code> || 通称 || 通称 || 路線の通称。 |- | <code>native_name</code> || {{n/a}} || 現地表記 || {{n/a}} || 路線の現地語表記(海外の鉄道など)。 |- | <code>native_name_lang</code> || {{n/a}} || || {{n/a}} || 現地語の種類。[[ISO 639-2コード一覧|ISO 639-2コード]]に準じる。言語を複数表記する場合は {{tl|lang}} を使う。 |- | <code>status</code> || <code>現況</code> || 現況 || 現況 || 路線の現況(計画中、工事中、廃止、未成など。現役路線では使用しない)。 |- | {{n/a}} || <code>国</code> || {{n/a}} || 国 || 路線が所在する国や地域。[[Wikipedia:Template国名3レターコード]]利用を想定。 |- | <code>locale</code> || <code>所在地</code> || 所在地 || 所在地 || 路線が通る地域名・自治体名(路線規模によって適宜簡潔にまとめる)。<br/>都道府県旗や地方旗の画像は挿入しない(詳しくは[[プロジェクト:鉄道#アイコン画像によるマークアップ]]を参照。「routes」「owner」「operator」の記述も、このガイドラインによるものです)。 |- | <code>coordinates</code> || {{n/a}} || 座標 || {{n/a}} || 路線の緯度と経度。{{Tl|Coord}}を使用。 |- | <code>type</code> || <code>種類</code> || 種別 || 種類 || 鉄道の類型([[高速鉄道]]、[[路面電車]]、[[モノレール]]など) |- | <code>system</code> || <code>路線網</code> || 系統 || 路線網 || 路線が属する路線網や系統、システム名。 |- | {{n/a}} || <code>区間</code> || {{n/a}} || 区間 || |- | <code>start</code> || <code>起点</code> || rowspan="2" style="vertical-align:top" | 起終点 || 起点 || 路線の起点駅や地域名。 |- | <code>end</code> || <code>終点</code> || 終点 || 路線の終点駅や地域名。 |- | <code>stations</code> || <code>駅数</code> || 駅数 || 駅数 || 駅の数(特記なければは起終点駅を含む)。 |- | {{n/a}} || <code>停留場数</code> || {{n/a}} || 停留場数 || 停留場の数(同上)。 |- | {{n/a}} || <code>停留所数</code> || {{n/a}} || 停留所数 || 停留所の数(同上)。 |- | <code>continuesfrom</code><br /><code>continuesas</code><br /><code>connectinglines</code><br /> || {{n/a}} || 接続路線 || {{n/a}} || 当該路線に接続する路線。 |- | <code>routes</code> || <code>経由路線</code><br /><code>構成路線</code> || 路線 || 経由路線 || 経由する線籍上の路線名称を記入([[運転系統]]向け)。<br/>路線シンボルマーク等の画像は挿入しない。 |- | <code>ridership2</code> || <code>輸送実績</code> || 乗客数 || 輸送実績 || 年単位等の輸送実績が公表されている場合に記入。 |- | <code>ridership</code> || <code>1日利用者数</code> || 1日の乗客数 || 1日利用者数 || 1日利用者数が公表されている場合に記入。 |- | {{n/a}} || <code>電報略号</code> || {{n/a}} || 電報略号 || 路線の[[電報略号 (鉄道)|電報略号]]。 |- | <code>trainnumber</code> || {{n/a}} || 列車番号 || {{n/a}} || チケットや時刻表に記入される列車番号。 |- | <code>linenumber</code> || <code>路線記号</code> || 路線記号 || 路線記号 || 路線記号。 |- | <code>routenumber</code> || <code>路線番号</code> || ルート番号 || 路線番号 || 路線番号(Infobox rail lineでは「路線諸元」に位置する)。 |- | <code>mapcolour</code><br /><code>mapcolor</code> || <code>路線色3</code> || 路線カラー || 路線色 || 路線色を冒頭の帯とは別に記載する場合に記入。 |- | <code>mapcolourlink</code><br /><code>mapcolorlink</code> || {{n/a}} || || {{n/a}} || 路線色のリンク先がある場合に記入。 |- | <code>website</code> || {{draw|提案中}} || ウェブサイト || {{draw|ウェブサイト}} || 路線の外部リンク(公式サイト等)を表示。 |- | <code>open</code> || <code>開業</code> || 開業 || 開業 || 路線が最初に開業した年月日。 |- | <code>event1</code><br /><code>event2</code><br /><code>event3</code><br /> || <code>日付1</code><br /><code>日付2</code><br /><code>日付3</code> ||<code>event1label</code><br /><code>event2label</code><br /><code>event3label</code> || <code>項目1</code><br /><code>項目2</code><br /><code>項目3</code> || 路線の延長、短縮、移管などの変遷日を任意のラベル名で記載。<br />"<code>項目1=</code>"のラベル名に対応した日付を"<code>日付1=</code>"に記入。3つまで設定可能。 |- | <code>lastextension</code> || <code>最終延伸</code> || 最終延伸 || 最終延伸 || 計画、工事路線が現段階で延伸した期日。 |- | {{draw|提案中}} || <code>全通</code> || {{draw|全通}} || 全通 || 予定された全区間が開業した期日。 |- | {{n/a}} || <code>休止</code> || {{n/a}} || 休止 || 路線が休止した年月日。 |- | <code>close</code> || <code>廃止</code> || 廃止 || 廃止 || 路線が廃止された年月日。 |- | <code>reopen</code> || <code>再開</code> || 再開 || 再開 || 休廃止後に再び開業した年月日。 |- | <code>owner</code> || <code>所有者</code> || 所有者 || 所有者 || 運営者と異なる所有者が存在する場合に記入(第一種、第三種鉄道事業に相当)。<br/>企業ロゴ等の画像は挿入しない。 |- | <code>operator</code> || <code>運営者</code><br /><code>運行者</code> || 運営者 || 運営者 || 路線を運営している事業者を記入(第一種、第二種鉄道事業に相当)。<br/>企業ロゴ等の画像は挿入しない。 |- | <code>conductionsystem</code> || {{n/a}} || 運行方法 || {{n/a}} || 路線の運行方法。 |- | <code>character</code> || <code>路線構造</code> || 路線構造 || 路線構造 || 路線の構造(高架など)。都市鉄道向け。 |- | {{n/a}} || <code>運転指令所</code> || {{n/a}} || 運転指令所 || 路線の運転指令所。 |- | <code>depot</code> || <code>車両基地</code> || 車両基地 || 車両基地 || 路線の車両基地や車庫。 |- | <code>stock</code> || <code>使用車両</code> || 使用車両 || 使用車両 || 路線で使われている車両(種類が多岐にわたる場合は使用しない)。 |- ! colspan="5" |路線諸元 |- | <code>linelength</code><br /><code>linelength_footnotes</code> || <code>路線距離</code><br /><code>総延長</code> || rowspan="3" | 路線総延長 || rowspan="3" | 路線距離 || 路線の総延長。キロメートル ([[キロメートル|km]]) で記載(要記号)。 |- | <code>linelength_km</code> || {{n/a}} || キロメートル→[[マイル]]自動変換機能。記号なしでキロメートル入力。 |- | <code>linelength_mi</code> || {{n/a}} || マイル→キロメートル自動変換機能。記号なしでマイル入力。 |- | <code>tracklength</code><br /><code>tracklength_footnotes</code> || {{n/a}} || rowspan="3" | 線路総延長 || {{n/a}} || 線路の総延長(例えば複線ならそれぞれの単線の長さを合算)。キロメートル (km) で記載(要記号)。 |- | <code>tracklength_km</code> || {{n/a}} || {{n/a}} || キロメートル→マイル自動変換機能。記号なしでキロメートル入力。 |- | <code>tracklength_mi</code> || {{n/a}} || {{n/a}} || マイル→キロメートル自動変換機能。記号なしでマイル入力。 |- | {{n/a}} || <code>営業キロ</code> || {{n/a}} || 営業キロ || [[営業キロ]]。 |- | <code>gauge</code> || <code>軌間</code> || 軌間 || 軌間 || 路線の[[軌間]]を記入。ミリメートル ([[ミリメートル|mm]]) で記載(要記号)。[[狭軌]]、[[標準軌]]、[[広軌]]といった補記は適宜手動入力。 |- | <code>ogauge</code> || {{n/a}} || 過去の軌間 || {{n/a}} || [[改軌]]前の軌間を記入。 |- | <code>notrack</code> || <code>線路数</code> || 路線数 || 線路数 || 単線、複線など路線上の線路数を記入。 |- | {{n/a}} || <code>複線区間</code> || {{n/a}} || 複線区間 || 複線区間。 |- | {{n/a}} || <code>電化区間</code> || {{n/a}} || 電化区間 || [[鉄道の電化|電化]]区間。 |- | <code>el</code> || <code>電化方式</code> || 電化 || 電化方式 || 路線の電圧や電化形式([[第三軌条方式]]、[[架空電車線方式]]等)。 |- | <code>lgauge</code> || <code>車両限界</code> || 車両限界 || 車両限界 || 路線の[[車両限界]]。 |- | <code>maxincline</code> || <code>最大勾配</code> || 最急勾配 || 最大勾配 || 路線の最急勾配。パーミル ([[パーミル|‰]]) で記載(要記号)。 |- | <code>minradius</code> || style="white-space:nowrap"| <code>最小曲線半径</code> || rowspan="3" | 最小曲線半径 || rowspan="3" style="white-space:nowrap"| 最小曲線半径 || 路線の最小曲線半径。メートル ([[メートル|m]]) で記載(要記号)。 |- | <code>minradius_m</code> || {{n/a}} || メートル→[[フィート]]自動変換機能。記号なしでメートル入力。 |- | <code>minradius_ft</code> || {{n/a}} || フィート→メートル自動変換機能。記号なしでフィート入力。 |- | <code>elevation</code> || {{n/a}} || rowspan="3" | 最高地点 || {{n/a}} || 路線の最標高地点。メートル (m) で記載(要記号)。 |- | <code>elevation_m</code> || {{n/a}} || {{n/a}} || メートル→フィート自動変換機能。記号なしでメートル入力。 |- | <code>elevation_ft</code> || {{n/a}} || {{n/a}} || フィート→メートル自動変換機能。記号なしでフィート入力。 |- | {{n/a}} || <code>高低差</code> || {{n/a}} || 高低差 || 路線の標高差([[登山鉄道]]等で使用)。メートル (m) で記載(要記号)。 |- | {{n/a}} || <code>閉塞方式</code> || {{n/a}} || 閉塞方式 || 路線の[[閉塞 (鉄道)|閉塞方式]]。 |- | {{n/a}} || <code>保安装置</code> || {{n/a}} || 保安装置 || 路線の[[自動列車保安装置|保安装置]]。 |- | <code>racksystem</code> || <code>ラック方式</code> || ラック方式 || ラック方式 || [[ラック式鉄道]]の方式を記入(例:[[アプト式]])。 |- | <code>ra</code> || {{n/a}} || RA || {{n/a}} || [[:en:Route availability]]。イギリスの線路規格。 |- | <code>speed</code> || <code>最高速度</code> || rowspan="3" | 運行速度 || rowspan="3" | 最高速度 || 路線の速度(最高速度)。キロメートル毎時 ([[キロメートル毎時|km/h]]) で記載(要記号)。 |- | <code>speed_km/h</code> || {{n/a}} || キロメートル毎時→[[マイル毎時]]自動変換機能。記号なしでキロメートル毎時入力。 |- | <code>speed_mph</code> || {{n/a}} || マイル毎時→キロメートル自動変換機能。記号なしでマイル毎時入力。 |- | <code>aveinterstation</code> || <code>駅間平均長</code> || 駅間平均長 || 駅間平均長 || 駅間平均距離。キロメートル (km) で記載(要記号)。 |- | {{n/a}} || <code>諸元備考内容</code> || {{n/a}} || <code>諸元備考</code> || 諸元に関する上記項目にない要素を盛り込む際に使用。<br />"<code>諸元備考=</code>"のラベル名(追加要素)に対応した内容を"<code>諸元備考内容=</code>"に記入。 |- ! colspan="5" |路線図 |- | <code>map</code> || <code>路線図</code> || || || 路線図を表示。 |- | <code>map_name</code> || <code>路線図名</code> || || || 図の上部にある「路線図」の名称を変更可能。 |- | <code>map_state</code> || <code>路線図表示</code> || || || <code>collapsed</code>と入力することでデフォルトで図を折り畳む。 |- |} == 例 == {{Infobox 鉄道路線 |路線名=A線 |路線色=#FF0000<!--赤--> |路線色2=#0000FF<!--青--> |ロゴ= |ロゴサイズ=50px<!--デフォルトサイズ--> |画像=Information example page2 300px.jpg |画像サイズ=250px<!--デフォルトサイズ--> |画像説明=表示例 |通称=エー線 |現況=休止 |国={{World}} |所在地=世界 |種類=[[高速鉄道]] |路線網=地球路線網 |起点=A駅 |終点=z停留所 |駅数=26駅 |停留場数=26停留場 |停留所数=26停留所 |経由路線=A本線、B支線、C連絡線 |輸送実績=3,650,000 (1950年) |1日利用者数=10,000 (1950年) |電報略号=エエ |路線記号=A |路線番号=1 |路線色3={{Color box|#008000}}<!--緑--> |開業=1910年1月1日 |項目1=国有化 |日付1=1920年2月2日 |項目2=民営化 |日付2=1930年3月3日 |項目3=区間縮小 |日付3=1940年4月4日 |最終延伸=1950年5月5日 |全通= |休止=1960年6月6日 |廃止= |再開= |所有者=地球 |運営者=人類 |車両基地=南極 |使用車両=[[#車両|車両]]を参照 |路線構造=高架 |路線距離=2,000km |営業キロ=1,500km |軌間=1,435 mm ([[標準軌]]) |線路数=[[単線]] |複線区間=A駅 - a停留場間 |電化区間=z停留場 - z停留所間 |電化方式=[[架空電車線方式]] |最大勾配=50‰ |最小曲線半径=500m |高低差=1,000m |閉塞方式=スタフ閉塞式 |保安装置=[[自動列車制御装置|ATC]] |ラック方式=マーシュ式 |最高速度=100km/h |路線図=Example.svg |路線図名=A線路線図 |路線図表示=collapsed }} <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名=A線 |路線色=#FF0000<!--赤--> |路線色2=#0000FF<!--青--> |ロゴ= |ロゴサイズ=50px<!--デフォルトサイズ--> |画像=Information example page2 300px.jpg |画像サイズ=250px<!--デフォルトサイズ--> |画像説明=表示例 |通称=エー線 |現況=休止 |国={{World}} |所在地=世界 |種類=[[高速鉄道]] |路線網=地球路線網 |起点=A駅 |終点=z停留所 |駅数=26駅 |停留場数=26停留場 |停留所数=26停留所 |経由路線=A本線、B支線、C連絡線 |輸送実績=3,650,000 (1950年) |1日利用者数=10,000 (1950年) |電報略号=エエ |路線記号=A |路線番号=1 |路線色3={{Color box|#008000}}<!--緑--> |開業=1910年1月1日 |項目1=国有化 |日付1=1920年2月2日 |項目2=民営化 |日付2=1930年3月3日 |項目3=区間縮小 |日付3=1940年4月4日 |最終延伸=1950年5月5日 |全通= |休止=1960年6月6日 |廃止= |再開= |所有者=地球 |運営者=人類 |車両基地=南極 |使用車両=[[#車両|車両]]を参照 |路線構造=高架 |路線距離=2,000km |営業キロ=1,500km |軌間=1,435 mm ([[標準軌]]) |線路数=[[単線]] |複線区間=A駅 - a停留場間 |電化区間=z停留場 - z停留所間 |電化方式=[[架空電車線方式]] |最大勾配=50‰ |最小曲線半径=500m |高低差=1,000m |閉塞方式=スタフ閉塞式 |保安装置=[[自動列車制御装置|ATC]] |ラック方式=マーシュ式 |最高速度=100km/h |路線図=Example.svg |路線図名=A線路線図 |路線図表示=collapsed }} </pre> == 使用例 == === 例1 === * [[山陽新幹線]] {{Infobox 鉄道路線 |路線名=[[File:JR logo (west).svg|35px|link=西日本旅客鉄道]] 山陽新幹線 |画像=JRW N700-7000series S1.jpg |画像サイズ=300px |画像説明=主に「さくら」で運転されているN700系7000番台 |国={{JPN}} |所在地=[[大阪府]]、[[兵庫県]]、[[岡山県]]、[[広島県]]、[[山口県]]、[[福岡県]] |種類=[[高速鉄道]]([[新幹線]]) |起点=[[新大阪駅]] |終点=[[博多駅]] |駅数=19駅 |開業=[[1972年]][[3月15日]] (新大阪駅-[[岡山駅]])<br />[[1975年]][[3月10日]] (岡山駅-博多駅) |所有者=[[西日本旅客鉄道]](JR西日本) |運営者=西日本旅客鉄道(JR西日本) |車両基地=[[博多総合車両所]] |路線距離=557.3 [[キロメートル|km]] |営業キロ=644.0 km |線路数=[[複線]] |軌間=1,435 [[ミリメートル|mm]] ([[標準軌]]) |電化方式=交流25,000[[ボルト (単位)|V]]・60[[ヘルツ|Hz]] [[架空電車線方式]] |最大勾配=15 [[パーミル|‰]] |最小曲線半径=4,000 [[メートル|m]] |閉塞方式=車内信号式 |保安装置=[[自動列車制御装置#ATC-1型(東海道・山陽型)|ATC-1W]]および[[自動列車制御装置#ATC-NS|ATC-NS]]([[新幹線700系電車|700系]]7000番台以外の車両における新大阪駅構内のみ) |最高速度=300 [[キロメートル毎時|km/h]] }} <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名=[[File:JR logo (west).svg|35px|link=西日本旅客鉄道]] 山陽新幹線 |画像=JRW N700-7000series S1.jpg |画像サイズ=300px |画像説明=主に「さくら」で運転されているN700系7000番台 |国={{JPN}} |所在地=[[大阪府]]、[[兵庫県]]、[[岡山県]]、[[広島県]]、[[山口県]]、[[福岡県]] |種類=[[高速鉄道]]([[新幹線]]) |起点=[[新大阪駅]] |終点=[[博多駅]] |駅数=19駅 |開業=[[1972年]][[3月15日]] (新大阪駅-[[岡山駅]])<br />[[1975年]][[3月10日]] (岡山駅-博多駅) |所有者=[[西日本旅客鉄道]](JR西日本) |運営者=西日本旅客鉄道(JR西日本) |車両基地=[[博多総合車両所]] |路線距離=557.3 [[キロメートル|km]] |営業キロ=644.0 km |線路数=[[複線]] |軌間=1,435 [[ミリメートル|mm]] ([[標準軌]]) |電化方式=交流25,000[[ボルト (単位)|V]]・60[[ヘルツ|Hz]] [[架空電車線方式]] |最大勾配=15 [[パーミル|‰]] |最小曲線半径=4,000 [[メートル|m]] |閉塞方式=車内信号式 |保安装置=[[自動列車制御装置#ATC-1型(東海道・山陽型)|ATC-1W]]および[[自動列車制御装置#ATC-NS|ATC-NS]]([[新幹線700系電車|700系]]7000番台以外の車両における新大阪駅構内のみ) |最高速度=300 [[キロメートル毎時|km/h]] }} </pre> === 例2 === * [[京浜東北線]] {{Infobox 鉄道路線 |路線名=[[File:JR logo (east).svg|35px|link=東日本旅客鉃道]] 京浜東北線 |路線色=#00b2e5 |ロゴ=JR JK line symbol.svg |ロゴサイズ=40px |画像=Series-E233-1000-113.jpg |画像サイズ=300px |画像説明=主力車両の[[JR東日本E233系電車|E233系1000番台]]<br>(2021年3月 さいたま新都心駅) |国={{JPN}} |所在地=[[埼玉県]]、[[東京都]]、[[神奈川県]] |種類=[[日本の鉄道|普通鉄道]]([[在来線]]・[[幹線]]) |区間=[[大宮駅 (埼玉県)|大宮駅]] - [[横浜駅]]間 |駅数=36駅 |電報略号=トホホセ(大宮 - 東京間)<br>トカホセ(東京 - 横浜間) |路線記号=JK |経由路線=[[東北本線]]、[[東海道本線]] |開業={{Start date and age|1914|12|20}} |廃止= |所有者=[[東日本旅客鉄道]](JR東日本) |運営者=東日本旅客鉄道(JR東日本) |車両基地=[[さいたま車両センター]] |使用車両=[[JR東日本E233系電車|E233系1000番台]] 10両 |路線距離=59.1 km |軌間=1,067 [[ミリメートル|mm]] |線路数=[[複線]] |電化方式=[[直流電化|直流]]1,500 [[ボルト (単位)|V]] [[架空電車線方式]] |最高速度=90 [[キロメートル毎時|km/h]] }} <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名=[[File:JR logo (east).svg|35px|link=東日本旅客鉃道]] 京浜東北線 |路線色=#00b2e5 |ロゴ=JR JK line symbol.svg |ロゴサイズ=40px |画像=Series-E233-1000-113.jpg |画像サイズ=300px |画像説明=主力車両の[[JR東日本E233系電車|E233系1000番台]]<br>(2021年3月 さいたま新都心駅) |国={{JPN}} |所在地=[[埼玉県]]、[[東京都]]、[[神奈川県]] |種類=[[日本の鉄道|普通鉄道]]([[在来線]]・[[幹線]]) |区間=[[大宮駅 (埼玉県)|大宮駅]] - [[横浜駅]]間 |駅数=36駅 |電報略号=トホホセ(大宮 - 東京間)<br>トカホセ(東京 - 横浜間) |路線記号=JK |経由路線=[[東北本線]]、[[東海道本線]] |開業={{Start date and age|1914|12|20}} |廃止= |所有者=[[東日本旅客鉄道]](JR東日本) |運営者=東日本旅客鉄道(JR東日本) |車両基地=[[さいたま車両センター]] |使用車両=[[JR東日本E233系電車|E233系1000番台]] 10両 |路線距離=59.1 km |軌間=1,067 [[ミリメートル|mm]] |線路数=[[複線]] |電化方式=[[直流電化|直流]]1,500 [[ボルト (単位)|V]] [[架空電車線方式]] |最高速度=90 [[キロメートル毎時|km/h]] }} </pre> === 例3 === * [[中央線快速]] {{Infobox 鉄道路線 |路線名=[[File:JR logo (east).svg|35px|東日本旅客鉄道|link=東日本旅客鉄道]] 中央線快速 |路線色=#f15a22 |ロゴ=JR JC line symbol.svg |ロゴサイズ=40px |画像=Series209-1000 E233-130th.jpg |画像サイズ=300px |画像説明=中央線快速の車両[[JR東日本209系電車|209系]](左)と[[JR東日本E233系電車|E233系]](右)<br />(2019年6月29日 [[西国分寺駅]]) |国={{JPN}} |所在地=[[東京都]] |種類=[[通勤列車]] |起点=[[東京駅]] |終点=[[高尾駅 (東京都)|高尾駅]] |駅数=24駅 |電報略号=チウホセ |路線記号=JC |経由路線=[[東北本線]](東京 - 神田間)<br>[[中央本線]](神田 - 代々木間、新宿 - 高尾間)<br>[[山手線]](代々木 - 新宿間) |開業={{Start date and age|1889|4|11}} |廃止= |所有者=[[東日本旅客鉄道]](JR東日本) |運営者=東日本旅客鉄道(JR東日本) |車両基地=[[豊田車両センター]] |使用車両=[[JR東日本E233系電車#0番台|E233系0番台]]<br>[[JR東日本209系電車#1000番台|209系1000番台]] |路線距離=53.1 [[キロメートル|km]] |軌間=1,067 [[ミリメートル|mm]] |線路数=[[複線]] |電化方式=[[直流電化|直流]]1,500 [[ボルト (単位)|V]] [[架空電車線方式]] |閉塞方式=自動閉塞式 |保安装置=[[自動列車停止装置#ATS-P形(デジタル伝送パターン形)|ATS-P]] |最高速度=100 [[キロメートル毎時|km/h]]<br>130 km/h(八王子 - 高尾間の特急列車) }} <pre style="overflow: auto;"> {{Infobox 鉄道路線 |路線名=[[File:JR logo (east).svg|35px|東日本旅客鉄道|link=東日本旅客鉄道]] 中央線快速 |路線色=#f15a22 |ロゴ=JR JC line symbol.svg |ロゴサイズ=40px |画像=Series209-1000 E233-130th.jpg |画像サイズ=300px |画像説明=中央線快速の車両[[JR東日本209系電車|209系]](左)と[[JR東日本E233系電車|E233系]](右)<br />(2019年6月29日 [[西国分寺駅]]) |国={{JPN}} |所在地=[[東京都]] |種類=[[通勤列車]] |起点=[[東京駅]] |終点=[[高尾駅 (東京都)|高尾駅]] |駅数=24駅 |電報略号=チウホセ |路線記号=JC |経由路線=[[東北本線]](東京 - 神田間)<br>[[中央本線]](神田 - 代々木間、新宿 - 高尾間)<br>[[山手線]](代々木 - 新宿間) |開業={{Start date and age|1889|4|11}} |廃止= |所有者=[[東日本旅客鉄道]](JR東日本) |運営者=東日本旅客鉄道(JR東日本) |車両基地=[[豊田車両センター]] |使用車両=[[JR東日本E233系電車#0番台|E233系0番台]]<br>[[JR東日本209系電車#1000番台|209系1000番台]] |路線距離=53.1 [[キロメートル|km]] |軌間=1,067 [[ミリメートル|mm]] |線路数=[[複線]] |電化方式=[[直流電化|直流]]1,500 [[ボルト (単位)|V]] [[架空電車線方式]] |閉塞方式=自動閉塞式 |保安装置=[[自動列車停止装置#ATS-P形(デジタル伝送パターン形)|ATS-P]] |最高速度=100 [[キロメートル毎時|km/h]]<br>130 km/h(八王子 - 高尾間の特急列車) }} </pre> == 関連テンプレート == * {{tl|Infobox 公共交通機関}} - 複数路線で構成されるネットワーク・システムの情報を集約する場合に用いるテンプレート。 * {{tl|BS-map}} - [[Wikipedia:経路図テンプレート|経路図]]を入力するテンプレート。 <includeonly> {{DEFAULTSORT:Infobox てつとうろせん}} [[Category:鉄道の基礎情報テンプレート|ろせん]] </includeonly> df7b4a689bd1858ab268893bdee004a72b6b6c17 テンプレート:Infobox 鉄道路線 10 12 172 37 2024-02-09T10:57:21Z Kyushujin 2 wikitext text/x-wiki {{Infobox |name = Infobox 鉄道路線 |bodyclass = |bodystyle = width:300px; |abovestyle = {{#if:{{{路線色|}}}|border-top: 4px solid {{{路線色}}}; border-bottom: 4px solid {{#if:{{{路線色2|}}}|{{{路線色2}}}|{{{路線色}}}}};}} |above = {{{路線名|{{PAGENAME}}}}} |subheader = {{#invoke:InfoboxImage|InfoboxImage|image={{{ロゴ|}}}|size={{{ロゴサイズ|90px}}}|sizedefault=90px|alt=シンボルマーク}} |image = {{#invoke:InfoboxImage|InfoboxImage|image={{{画像|}}}|size={{{画像サイズ|300px}}}|sizedefault=300px|alt={{{画像説明|}}}}} |caption = {{{画像説明<includeonly>|</includeonly>}}} |headerstyle= background: #efefef; |header1 = 基本情報 |label2 = 通称 |data2 = {{{通称<includeonly>|</includeonly>}}} |label3 = 現況 |data3 = {{{現況<includeonly>|</includeonly>}}} |label4 = 国 |data4 = {{{国<includeonly>|</includeonly>}}} |label5 = 所在地 |data5 = {{{所在地<includeonly>|</includeonly>}}} |label7 = 種類 |data7 = {{{種類<includeonly>|</includeonly>}}} |label8 = 路線網 |data8 = {{{路線網<includeonly>|</includeonly>}}} |label9 = 区間 |data9 = {{{区間<includeonly>|</includeonly>}}} |label10 = 起点 |data10 = {{{起点<includeonly>|</includeonly>}}} |label11 = 終点 |data11 = {{{終点<includeonly>|</includeonly>}}} |label12 = 駅数 |data12 = {{{駅数<includeonly>|</includeonly>}}} |label13 = 停留場数 |data13 = {{{停留場数<includeonly>|</includeonly>}}} |label14 = 停留所数 |data14 = {{{停留所数<includeonly>|</includeonly>}}} |label15 = 経由路線 |data15 = {{{経由路線<includeonly>|</includeonly>{{{構成路線|}}}}}} |label16 = 輸送実績 |data16 = {{{輸送実績<includeonly>|</includeonly>}}} |label17 = 1日利用者数 |data17 = {{{1日利用者数<includeonly>|</includeonly>}}} |label18 = 電報略号 |data18 = {{{電報略号<includeonly>|</includeonly>}}} |label19 = 路線記号 |data19 = {{{路線記号<includeonly>|</includeonly>}}} |label20 = 路線番号 |data20 = {{{路線番号<includeonly>|</includeonly>}}} |label21 = 路線色 |data21 = {{{路線色3<includeonly>|</includeonly>}}} |header30 = <!--運営--> |label31 = 開業 |data31 = {{{開業<includeonly>|</includeonly>}}} |label32 = {{{項目1|}}} |data32 = {{{日付1|}}} |label33 = {{{項目2|}}} |data33 = {{{日付2|}}} |label34 = {{{項目3|}}} |data34 = {{{日付3|}}} |label35 = 最終延伸 |data35 = {{{最終延伸<includeonly>|</includeonly>}}} |label36 = 全通 |data36 = {{{全通<includeonly>|</includeonly>}}} |label37 = 休止 |data37 = {{{休止<includeonly>|</includeonly>}}} |label38 = 廃止 |data38 = {{{廃止<includeonly>|</includeonly>}}} |label39 = 再開 |data39 = {{{再開<includeonly>|</includeonly>}}} |label40 = 所有者 |data40 = {{{所有者<includeonly>|</includeonly>}}} |label41 = 運営者 |data41 = {{{運営者<includeonly>|</includeonly>{{{運行者|}}}}}} |label42 = 路線構造 |data42 = {{{路線構造<includeonly>|</includeonly>}}} |label43 = 運転指令所 |data43 = {{{運転指令所<includeonly>|</includeonly>}}} |label44 = 車両基地 |data44 = {{{車両基地<includeonly>|</includeonly>}}} |label45 = 使用車両 |data45 = {{{使用車両<includeonly>|</includeonly>}}} |header50 = 路線諸元 |label51 = 路線距離 |data51 = {{{路線距離<includeonly>|</includeonly>{{{総延長|}}}}}} |label53 = 営業キロ |data53 = {{{営業キロ<includeonly>|</includeonly>}}} |label54 = [[軌間]] |data54 = {{{軌間<includeonly>|</includeonly>}}} |label57 = 線路数 |data57 = {{{線路数<includeonly>|</includeonly>}}} |label58 = 複線区間 |data58 = {{{複線区間|}}} |label59 = 電化区間 |data59 = {{{電化区間|}}} |label60 = [[鉄道の電化|電化方式]] |data60 = {{{電化方式<includeonly>|</includeonly>}}} |label61 = 車両限界 |data61 = {{{車両限界<includeonly>|</includeonly>}}} |label62 = 最大勾配 |data62 = {{{最大勾配<includeonly>|</includeonly>}}} |label63 = [[線形 (路線)#平面線形|最小曲線半径]] |data63 = {{{最小曲線半径<includeonly>|</includeonly>}}} |label64 = 高低差 |data64 = {{{高低差<includeonly>|</includeonly>}}} |label65 = 閉塞方式 |data65 = {{{閉塞方式<includeonly>|</includeonly>}}} |label66 = 保安装置 |data66 = {{{保安装置<includeonly>|</includeonly>}}} |label67 = ラック方式 |data67 = {{{ラック方式<includeonly>|</includeonly>}}} |label68 = 最高速度 |data68 = {{{最高速度<includeonly>|</includeonly>}}} |label69 = 駅間平均長 |data69 = {{{駅間平均長<includeonly>|</includeonly>}}} |label70 = {{{諸元備考<includeonly>|</includeonly>}}} |data70 = {{{諸元備考内容<includeonly>|</includeonly>}}} |belowstyle = vertical-align: middle; padding:0px; |below = {{#if:{{{路線図<includeonly>|</includeonly>}}}| <table style="width:100%; margin:0; border:none;" class="mw-collapsible {{#switch:{{{路線図表示|}}}|0 |no |#default = no |1 |yes |collapsed = mw-collapsed autocollapse }}"> <tr style="background-color: #efefef"><th>{{#if:{{{路線図名|}}}|{{{路線図名}}}|路線図}}</th></tr> <tr><td style="text-align:center"> {{#invoke:InfoboxImage|InfoboxImage|image={{{路線図<noinclude>|File:Placeholder.svg</noinclude>}}}|size=|sizedefault=300px}}</td></tr> </table>}} }}<noinclude>{{Documentation}}</noinclude> e50e725a302714dc811bf98e52b803c234376882 173 172 2024-02-09T10:58:00Z Kyushujin 2 wikitext text/x-wiki {{Infobox |name = Infobox 鉄道路線 |bodyclass = |bodystyle = width:300px; |abovestyle = {{#if:{{{路線色|}}}|border-top: 4px solid {{{路線色}}}; border-bottom: 4px solid {{#if:{{{路線色2|}}}|{{{路線色2}}}|{{{路線色}}}}};}} |above = {{{路線名|{{PAGENAME}}}}} |subheader = {{#invoke:InfoboxImage|InfoboxImage|image={{{ロゴ|}}}|size={{{ロゴサイズ|90px}}}|sizedefault=90px|alt=シンボルマーク}} |image = {{#invoke:InfoboxImage|InfoboxImage|image={{{画像|}}}|size={{{画像サイズ|300px}}}|sizedefault=300px|alt={{{画像説明|}}}}} |caption = {{{画像説明<includeonly>|</includeonly>}}} |headerstyle= background: #efefef; |header1 = 基本情報 |label2 = 通称 |data2 = {{{通称<includeonly>|</includeonly>}}} |label3 = 現況 |data3 = {{{現況<includeonly>|</includeonly>}}} |label4 = 国 |data4 = {{{国<includeonly>|</includeonly>}}} |label5 = 所在地 |data5 = {{{所在地<includeonly>|</includeonly>}}} |label7 = 種類 |data7 = {{{種類<includeonly>|</includeonly>}}} |label8 = 路線網 |data8 = {{{路線網<includeonly>|</includeonly>}}} |label9 = 区間 |data9 = {{{区間<includeonly>|</includeonly>}}} |label10 = 起点 |data10 = {{{起点<includeonly>|</includeonly>}}} |label11 = 終点 |data11 = {{{終点<includeonly>|</includeonly>}}} |label12 = 駅数 |data12 = {{{駅数<includeonly>|</includeonly>}}} |label13 = 停留場数 |data13 = {{{停留場数<includeonly>|</includeonly>}}} |label14 = 停留所数 |data14 = {{{停留所数<includeonly>|</includeonly>}}} |label15 = 経由路線 |data15 = {{{経由路線<includeonly>|</includeonly>{{{構成路線|}}}}}} |label16 = 輸送実績 |data16 = {{{輸送実績<includeonly>|</includeonly>}}} |label17 = 1日利用者数 |data17 = {{{1日利用者数<includeonly>|</includeonly>}}} |label18 = 電報略号 |data18 = {{{電報略号<includeonly>|</includeonly>}}} |label19 = 路線記号 |data19 = {{{路線記号<includeonly>|</includeonly>}}} |label20 = 路線番号 |data20 = {{{路線番号<includeonly>|</includeonly>}}} |label21 = 路線色 |data21 = {{{路線色3<includeonly>|</includeonly>}}} |header30 = <!--運営--> |label31 = 開業 |data31 = {{{開業<includeonly>|</includeonly>}}} |label32 = {{{項目1|}}} |data32 = {{{日付1|}}} |label33 = {{{項目2|}}} |data33 = {{{日付2|}}} |label34 = {{{項目3|}}} |data34 = {{{日付3|}}} |label35 = 最終延伸 |data35 = {{{最終延伸<includeonly>|</includeonly>}}} |label36 = 全通 |data36 = {{{全通<includeonly>|</includeonly>}}} |label37 = 休止 |data37 = {{{休止<includeonly>|</includeonly>}}} |label38 = 廃止 |data38 = {{{廃止<includeonly>|</includeonly>}}} |label39 = 再開 |data39 = {{{再開<includeonly>|</includeonly>}}} |label40 = 所有者 |data40 = {{{所有者<includeonly>|</includeonly>}}} |label41 = 運営者 |data41 = {{{運営者<includeonly>|</includeonly>{{{運行者|}}}}}} |label42 = 路線構造 |data42 = {{{路線構造<includeonly>|</includeonly>}}} |label43 = 運転指令所 |data43 = {{{運転指令所<includeonly>|</includeonly>}}} |label44 = 車両基地 |data44 = {{{車両基地<includeonly>|</includeonly>}}} |label45 = 使用車両 |data45 = {{{使用車両<includeonly>|</includeonly>}}} |header50 = 路線諸元 |label51 = 路線距離 |data51 = {{{路線距離<includeonly>|</includeonly>{{{総延長|}}}}}} |label53 = 営業キロ |data53 = {{{営業キロ<includeonly>|</includeonly>}}} |label54 = 軌間 |data54 = {{{軌間<includeonly>|</includeonly>}}} |label57 = 線路数 |data57 = {{{線路数<includeonly>|</includeonly>}}} |label58 = 複線区間 |data58 = {{{複線区間|}}} |label59 = 電化区間 |data59 = {{{電化区間|}}} |label60 = [[鉄道の電化|電化方式]] |data60 = {{{電化方式<includeonly>|</includeonly>}}} |label61 = 車両限界 |data61 = {{{車両限界<includeonly>|</includeonly>}}} |label62 = 最大勾配 |data62 = {{{最大勾配<includeonly>|</includeonly>}}} |label63 = [[線形 (路線)#平面線形|最小曲線半径]] |data63 = {{{最小曲線半径<includeonly>|</includeonly>}}} |label64 = 高低差 |data64 = {{{高低差<includeonly>|</includeonly>}}} |label65 = 閉塞方式 |data65 = {{{閉塞方式<includeonly>|</includeonly>}}} |label66 = 保安装置 |data66 = {{{保安装置<includeonly>|</includeonly>}}} |label67 = ラック方式 |data67 = {{{ラック方式<includeonly>|</includeonly>}}} |label68 = 最高速度 |data68 = {{{最高速度<includeonly>|</includeonly>}}} |label69 = 駅間平均長 |data69 = {{{駅間平均長<includeonly>|</includeonly>}}} |label70 = {{{諸元備考<includeonly>|</includeonly>}}} |data70 = {{{諸元備考内容<includeonly>|</includeonly>}}} |belowstyle = vertical-align: middle; padding:0px; |below = {{#if:{{{路線図<includeonly>|</includeonly>}}}| <table style="width:100%; margin:0; border:none;" class="mw-collapsible {{#switch:{{{路線図表示|}}}|0 |no |#default = no |1 |yes |collapsed = mw-collapsed autocollapse }}"> <tr style="background-color: #efefef"><th>{{#if:{{{路線図名|}}}|{{{路線図名}}}|路線図}}</th></tr> <tr><td style="text-align:center"> {{#invoke:InfoboxImage|InfoboxImage|image={{{路線図<noinclude>|File:Placeholder.svg</noinclude>}}}|size=|sizedefault=300px}}</td></tr> </table>}} }}<noinclude>{{Documentation}}</noinclude> 0cc08b23a2ca953bcba576610f5d88264e778a28 174 173 2024-02-09T10:58:28Z Kyushujin 2 wikitext text/x-wiki {{Infobox |name = Infobox 鉄道路線 |bodyclass = |bodystyle = width:300px; |abovestyle = {{#if:{{{路線色|}}}|border-top: 4px solid {{{路線色}}}; border-bottom: 4px solid {{#if:{{{路線色2|}}}|{{{路線色2}}}|{{{路線色}}}}};}} |above = {{{路線名|{{PAGENAME}}}}} |subheader = {{#invoke:InfoboxImage|InfoboxImage|image={{{ロゴ|}}}|size={{{ロゴサイズ|90px}}}|sizedefault=90px|alt=シンボルマーク}} |image = {{#invoke:InfoboxImage|InfoboxImage|image={{{画像|}}}|size={{{画像サイズ|300px}}}|sizedefault=300px|alt={{{画像説明|}}}}} |caption = {{{画像説明<includeonly>|</includeonly>}}} |headerstyle= background: #efefef; |header1 = 基本情報 |label2 = 通称 |data2 = {{{通称<includeonly>|</includeonly>}}} |label3 = 現況 |data3 = {{{現況<includeonly>|</includeonly>}}} |label4 = 国 |data4 = {{{国<includeonly>|</includeonly>}}} |label5 = 所在地 |data5 = {{{所在地<includeonly>|</includeonly>}}} |label7 = 種類 |data7 = {{{種類<includeonly>|</includeonly>}}} |label8 = 路線網 |data8 = {{{路線網<includeonly>|</includeonly>}}} |label9 = 区間 |data9 = {{{区間<includeonly>|</includeonly>}}} |label10 = 起点 |data10 = {{{起点<includeonly>|</includeonly>}}} |label11 = 終点 |data11 = {{{終点<includeonly>|</includeonly>}}} |label12 = 駅数 |data12 = {{{駅数<includeonly>|</includeonly>}}} |label13 = 停留場数 |data13 = {{{停留場数<includeonly>|</includeonly>}}} |label14 = 停留所数 |data14 = {{{停留所数<includeonly>|</includeonly>}}} |label15 = 経由路線 |data15 = {{{経由路線<includeonly>|</includeonly>{{{構成路線|}}}}}} |label16 = 輸送実績 |data16 = {{{輸送実績<includeonly>|</includeonly>}}} |label17 = 1日利用者数 |data17 = {{{1日利用者数<includeonly>|</includeonly>}}} |label18 = 電報略号 |data18 = {{{電報略号<includeonly>|</includeonly>}}} |label19 = 路線記号 |data19 = {{{路線記号<includeonly>|</includeonly>}}} |label20 = 路線番号 |data20 = {{{路線番号<includeonly>|</includeonly>}}} |label21 = 路線色 |data21 = {{{路線色3<includeonly>|</includeonly>}}} |header30 = <!--運営--> |label31 = 開業 |data31 = {{{開業<includeonly>|</includeonly>}}} |label32 = {{{項目1|}}} |data32 = {{{日付1|}}} |label33 = {{{項目2|}}} |data33 = {{{日付2|}}} |label34 = {{{項目3|}}} |data34 = {{{日付3|}}} |label35 = 最終延伸 |data35 = {{{最終延伸<includeonly>|</includeonly>}}} |label36 = 全通 |data36 = {{{全通<includeonly>|</includeonly>}}} |label37 = 休止 |data37 = {{{休止<includeonly>|</includeonly>}}} |label38 = 廃止 |data38 = {{{廃止<includeonly>|</includeonly>}}} |label39 = 再開 |data39 = {{{再開<includeonly>|</includeonly>}}} |label40 = 所有者 |data40 = {{{所有者<includeonly>|</includeonly>}}} |label41 = 運営者 |data41 = {{{運営者<includeonly>|</includeonly>{{{運行者|}}}}}} |label42 = 路線構造 |data42 = {{{路線構造<includeonly>|</includeonly>}}} |label43 = 運転指令所 |data43 = {{{運転指令所<includeonly>|</includeonly>}}} |label44 = 車両基地 |data44 = {{{車両基地<includeonly>|</includeonly>}}} |label45 = 使用車両 |data45 = {{{使用車両<includeonly>|</includeonly>}}} |header50 = 路線諸元 |label51 = 路線距離 |data51 = {{{路線距離<includeonly>|</includeonly>{{{総延長|}}}}}} |label53 = 営業キロ |data53 = {{{営業キロ<includeonly>|</includeonly>}}} |label54 = 軌間 |data54 = {{{軌間<includeonly>|</includeonly>}}} |label57 = 線路数 |data57 = {{{線路数<includeonly>|</includeonly>}}} |label58 = 複線区間 |data58 = {{{複線区間|}}} |label59 = 電化区間 |data59 = {{{電化区間|}}} |label60 = 電化方式 |data60 = {{{電化方式<includeonly>|</includeonly>}}} |label61 = 車両限界 |data61 = {{{車両限界<includeonly>|</includeonly>}}} |label62 = 最大勾配 |data62 = {{{最大勾配<includeonly>|</includeonly>}}} |label63 = 最小曲線半径 |data63 = {{{最小曲線半径<includeonly>|</includeonly>}}} |label64 = 高低差 |data64 = {{{高低差<includeonly>|</includeonly>}}} |label65 = 閉塞方式 |data65 = {{{閉塞方式<includeonly>|</includeonly>}}} |label66 = 保安装置 |data66 = {{{保安装置<includeonly>|</includeonly>}}} |label67 = ラック方式 |data67 = {{{ラック方式<includeonly>|</includeonly>}}} |label68 = 最高速度 |data68 = {{{最高速度<includeonly>|</includeonly>}}} |label69 = 駅間平均長 |data69 = {{{駅間平均長<includeonly>|</includeonly>}}} |label70 = {{{諸元備考<includeonly>|</includeonly>}}} |data70 = {{{諸元備考内容<includeonly>|</includeonly>}}} |belowstyle = vertical-align: middle; padding:0px; |below = {{#if:{{{路線図<includeonly>|</includeonly>}}}| <table style="width:100%; margin:0; border:none;" class="mw-collapsible {{#switch:{{{路線図表示|}}}|0 |no |#default = no |1 |yes |collapsed = mw-collapsed autocollapse }}"> <tr style="background-color: #efefef"><th>{{#if:{{{路線図名|}}}|{{{路線図名}}}|路線図}}</th></tr> <tr><td style="text-align:center"> {{#invoke:InfoboxImage|InfoboxImage|image={{{路線図<noinclude>|File:Placeholder.svg</noinclude>}}}|size=|sizedefault=300px}}</td></tr> </table>}} }}<noinclude>{{Documentation}}</noinclude> 33a274b3a66c2f04a9c731461d7122d59170ff37 176 174 2024-02-09T15:31:28Z Kyushujin 2 wikitext text/x-wiki このテンプレートはWikipedia[https://ja.wikipedia.org/wiki/Template:%E9%89%84%E9%81%93%E8%B7%AF%E7%B7%9A]からお借りして使用しています。 {{Infobox |name = Infobox 鉄道路線 |bodyclass = |bodystyle = width:300px; |abovestyle = {{#if:{{{路線色|}}}|border-top: 4px solid {{{路線色}}}; border-bottom: 4px solid {{#if:{{{路線色2|}}}|{{{路線色2}}}|{{{路線色}}}}};}} |above = {{{路線名|{{PAGENAME}}}}} |subheader = {{#invoke:InfoboxImage|InfoboxImage|image={{{ロゴ|}}}|size={{{ロゴサイズ|90px}}}|sizedefault=90px|alt=シンボルマーク}} |image = {{#invoke:InfoboxImage|InfoboxImage|image={{{画像|}}}|size={{{画像サイズ|300px}}}|sizedefault=300px|alt={{{画像説明|}}}}} |caption = {{{画像説明<includeonly>|</includeonly>}}} |headerstyle= background: #efefef; |header1 = 基本情報 |label2 = 通称 |data2 = {{{通称<includeonly>|</includeonly>}}} |label3 = 現況 |data3 = {{{現況<includeonly>|</includeonly>}}} |label4 = 国 |data4 = {{{国<includeonly>|</includeonly>}}} |label5 = 所在地 |data5 = {{{所在地<includeonly>|</includeonly>}}} |label7 = 種類 |data7 = {{{種類<includeonly>|</includeonly>}}} |label8 = 路線網 |data8 = {{{路線網<includeonly>|</includeonly>}}} |label9 = 区間 |data9 = {{{区間<includeonly>|</includeonly>}}} |label10 = 起点 |data10 = {{{起点<includeonly>|</includeonly>}}} |label11 = 終点 |data11 = {{{終点<includeonly>|</includeonly>}}} |label12 = 駅数 |data12 = {{{駅数<includeonly>|</includeonly>}}} |label13 = 停留場数 |data13 = {{{停留場数<includeonly>|</includeonly>}}} |label14 = 停留所数 |data14 = {{{停留所数<includeonly>|</includeonly>}}} |label15 = 経由路線 |data15 = {{{経由路線<includeonly>|</includeonly>{{{構成路線|}}}}}} |label16 = 輸送実績 |data16 = {{{輸送実績<includeonly>|</includeonly>}}} |label17 = 1日利用者数 |data17 = {{{1日利用者数<includeonly>|</includeonly>}}} |label18 = 電報略号 |data18 = {{{電報略号<includeonly>|</includeonly>}}} |label19 = 路線記号 |data19 = {{{路線記号<includeonly>|</includeonly>}}} |label20 = 路線番号 |data20 = {{{路線番号<includeonly>|</includeonly>}}} |label21 = 路線色 |data21 = {{{路線色3<includeonly>|</includeonly>}}} |header30 = <!--運営--> |label31 = 開業 |data31 = {{{開業<includeonly>|</includeonly>}}} |label32 = {{{項目1|}}} |data32 = {{{日付1|}}} |label33 = {{{項目2|}}} |data33 = {{{日付2|}}} |label34 = {{{項目3|}}} |data34 = {{{日付3|}}} |label35 = 最終延伸 |data35 = {{{最終延伸<includeonly>|</includeonly>}}} |label36 = 全通 |data36 = {{{全通<includeonly>|</includeonly>}}} |label37 = 休止 |data37 = {{{休止<includeonly>|</includeonly>}}} |label38 = 廃止 |data38 = {{{廃止<includeonly>|</includeonly>}}} |label39 = 再開 |data39 = {{{再開<includeonly>|</includeonly>}}} |label40 = 所有者 |data40 = {{{所有者<includeonly>|</includeonly>}}} |label41 = 運営者 |data41 = {{{運営者<includeonly>|</includeonly>{{{運行者|}}}}}} |label42 = 路線構造 |data42 = {{{路線構造<includeonly>|</includeonly>}}} |label43 = 運転指令所 |data43 = {{{運転指令所<includeonly>|</includeonly>}}} |label44 = 車両基地 |data44 = {{{車両基地<includeonly>|</includeonly>}}} |label45 = 使用車両 |data45 = {{{使用車両<includeonly>|</includeonly>}}} |header50 = 路線諸元 |label51 = 路線距離 |data51 = {{{路線距離<includeonly>|</includeonly>{{{総延長|}}}}}} |label53 = 営業キロ |data53 = {{{営業キロ<includeonly>|</includeonly>}}} |label54 = 軌間 |data54 = {{{軌間<includeonly>|</includeonly>}}} |label57 = 線路数 |data57 = {{{線路数<includeonly>|</includeonly>}}} |label58 = 複線区間 |data58 = {{{複線区間|}}} |label59 = 電化区間 |data59 = {{{電化区間|}}} |label60 = 電化方式 |data60 = {{{電化方式<includeonly>|</includeonly>}}} |label61 = 車両限界 |data61 = {{{車両限界<includeonly>|</includeonly>}}} |label62 = 最大勾配 |data62 = {{{最大勾配<includeonly>|</includeonly>}}} |label63 = 最小曲線半径 |data63 = {{{最小曲線半径<includeonly>|</includeonly>}}} |label64 = 高低差 |data64 = {{{高低差<includeonly>|</includeonly>}}} |label65 = 閉塞方式 |data65 = {{{閉塞方式<includeonly>|</includeonly>}}} |label66 = 保安装置 |data66 = {{{保安装置<includeonly>|</includeonly>}}} |label67 = ラック方式 |data67 = {{{ラック方式<includeonly>|</includeonly>}}} |label68 = 最高速度 |data68 = {{{最高速度<includeonly>|</includeonly>}}} |label69 = 駅間平均長 |data69 = {{{駅間平均長<includeonly>|</includeonly>}}} |label70 = {{{諸元備考<includeonly>|</includeonly>}}} |data70 = {{{諸元備考内容<includeonly>|</includeonly>}}} |belowstyle = vertical-align: middle; padding:0px; |below = {{#if:{{{路線図<includeonly>|</includeonly>}}}| <table style="width:100%; margin:0; border:none;" class="mw-collapsible {{#switch:{{{路線図表示|}}}|0 |no |#default = no |1 |yes |collapsed = mw-collapsed autocollapse }}"> <tr style="background-color: #efefef"><th>{{#if:{{{路線図名|}}}|{{{路線図名}}}|路線図}}</th></tr> <tr><td style="text-align:center"> {{#invoke:InfoboxImage|InfoboxImage|image={{{路線図<noinclude>|File:Placeholder.svg</noinclude>}}}|size=|sizedefault=300px}}</td></tr> </table>}} }}<noinclude>{{Documentation}}</noinclude> 860cc86c142d6b1f6caed7bdc20e54c678d5f7d8 177 176 2024-02-09T15:39:16Z Kyushujin 2 wikitext text/x-wiki 。 {{Infobox |name = Infobox 鉄道路線 |bodyclass = |bodystyle = width:300px; |abovestyle = {{#if:{{{路線色|}}}|border-top: 4px solid {{{路線色}}}; border-bottom: 4px solid {{#if:{{{路線色2|}}}|{{{路線色2}}}|{{{路線色}}}}};}} |above = {{{路線名|{{PAGENAME}}}}} |subheader = {{#invoke:InfoboxImage|InfoboxImage|image={{{ロゴ|}}}|size={{{ロゴサイズ|90px}}}|sizedefault=90px|alt=シンボルマーク}} |image = {{#invoke:InfoboxImage|InfoboxImage|image={{{画像|}}}|size={{{画像サイズ|300px}}}|sizedefault=300px|alt={{{画像説明|}}}}} |caption = {{{画像説明<includeonly>|</includeonly>}}} |headerstyle= background: #efefef; |header1 = 基本情報 |label2 = 通称 |data2 = {{{通称<includeonly>|</includeonly>}}} |label3 = 現況 |data3 = {{{現況<includeonly>|</includeonly>}}} |label4 = 国 |data4 = {{{国<includeonly>|</includeonly>}}} |label5 = 所在地 |data5 = {{{所在地<includeonly>|</includeonly>}}} |label7 = 種類 |data7 = {{{種類<includeonly>|</includeonly>}}} |label8 = 路線網 |data8 = {{{路線網<includeonly>|</includeonly>}}} |label9 = 区間 |data9 = {{{区間<includeonly>|</includeonly>}}} |label10 = 起点 |data10 = {{{起点<includeonly>|</includeonly>}}} |label11 = 終点 |data11 = {{{終点<includeonly>|</includeonly>}}} |label12 = 駅数 |data12 = {{{駅数<includeonly>|</includeonly>}}} |label13 = 停留場数 |data13 = {{{停留場数<includeonly>|</includeonly>}}} |label14 = 停留所数 |data14 = {{{停留所数<includeonly>|</includeonly>}}} |label15 = 経由路線 |data15 = {{{経由路線<includeonly>|</includeonly>{{{構成路線|}}}}}} |label16 = 輸送実績 |data16 = {{{輸送実績<includeonly>|</includeonly>}}} |label17 = 1日利用者数 |data17 = {{{1日利用者数<includeonly>|</includeonly>}}} |label18 = 電報略号 |data18 = {{{電報略号<includeonly>|</includeonly>}}} |label19 = 路線記号 |data19 = {{{路線記号<includeonly>|</includeonly>}}} |label20 = 路線番号 |data20 = {{{路線番号<includeonly>|</includeonly>}}} |label21 = 路線色 |data21 = {{{路線色3<includeonly>|</includeonly>}}} |header30 = <!--運営--> |label31 = 開業 |data31 = {{{開業<includeonly>|</includeonly>}}} |label32 = {{{項目1|}}} |data32 = {{{日付1|}}} |label33 = {{{項目2|}}} |data33 = {{{日付2|}}} |label34 = {{{項目3|}}} |data34 = {{{日付3|}}} |label35 = 最終延伸 |data35 = {{{最終延伸<includeonly>|</includeonly>}}} |label36 = 全通 |data36 = {{{全通<includeonly>|</includeonly>}}} |label37 = 休止 |data37 = {{{休止<includeonly>|</includeonly>}}} |label38 = 廃止 |data38 = {{{廃止<includeonly>|</includeonly>}}} |label39 = 再開 |data39 = {{{再開<includeonly>|</includeonly>}}} |label40 = 所有者 |data40 = {{{所有者<includeonly>|</includeonly>}}} |label41 = 運営者 |data41 = {{{運営者<includeonly>|</includeonly>{{{運行者|}}}}}} |label42 = 路線構造 |data42 = {{{路線構造<includeonly>|</includeonly>}}} |label43 = 運転指令所 |data43 = {{{運転指令所<includeonly>|</includeonly>}}} |label44 = 車両基地 |data44 = {{{車両基地<includeonly>|</includeonly>}}} |label45 = 使用車両 |data45 = {{{使用車両<includeonly>|</includeonly>}}} |header50 = 路線諸元 |label51 = 路線距離 |data51 = {{{路線距離<includeonly>|</includeonly>{{{総延長|}}}}}} |label53 = 営業キロ |data53 = {{{営業キロ<includeonly>|</includeonly>}}} |label54 = 軌間 |data54 = {{{軌間<includeonly>|</includeonly>}}} |label57 = 線路数 |data57 = {{{線路数<includeonly>|</includeonly>}}} |label58 = 複線区間 |data58 = {{{複線区間|}}} |label59 = 電化区間 |data59 = {{{電化区間|}}} |label60 = 電化方式 |data60 = {{{電化方式<includeonly>|</includeonly>}}} |label61 = 車両限界 |data61 = {{{車両限界<includeonly>|</includeonly>}}} |label62 = 最大勾配 |data62 = {{{最大勾配<includeonly>|</includeonly>}}} |label63 = 最小曲線半径 |data63 = {{{最小曲線半径<includeonly>|</includeonly>}}} |label64 = 高低差 |data64 = {{{高低差<includeonly>|</includeonly>}}} |label65 = 閉塞方式 |data65 = {{{閉塞方式<includeonly>|</includeonly>}}} |label66 = 保安装置 |data66 = {{{保安装置<includeonly>|</includeonly>}}} |label67 = ラック方式 |data67 = {{{ラック方式<includeonly>|</includeonly>}}} |label68 = 最高速度 |data68 = {{{最高速度<includeonly>|</includeonly>}}} |label69 = 駅間平均長 |data69 = {{{駅間平均長<includeonly>|</includeonly>}}} |label70 = {{{諸元備考<includeonly>|</includeonly>}}} |data70 = {{{諸元備考内容<includeonly>|</includeonly>}}} |belowstyle = vertical-align: middle; padding:0px; |below = {{#if:{{{路線図<includeonly>|</includeonly>}}}| <table style="width:100%; margin:0; border:none;" class="mw-collapsible {{#switch:{{{路線図表示|}}}|0 |no |#default = no |1 |yes |collapsed = mw-collapsed autocollapse }}"> <tr style="background-color: #efefef"><th>{{#if:{{{路線図名|}}}|{{{路線図名}}}|路線図}}</th></tr> <tr><td style="text-align:center"> {{#invoke:InfoboxImage|InfoboxImage|image={{{路線図<noinclude>|File:Placeholder.svg</noinclude>}}}|size=|sizedefault=300px}}</td></tr> </table>}} }}<noinclude>{{Documentation}}</noinclude> f618d890960c67064477711f0c78ccd306454e06 178 177 2024-02-09T15:40:11Z Kyushujin 2 wikitext text/x-wiki {{Infobox |name = Infobox 鉄道路線 |bodyclass = |bodystyle = width:300px; |abovestyle = {{#if:{{{路線色|}}}|border-top: 4px solid {{{路線色}}}; border-bottom: 4px solid {{#if:{{{路線色2|}}}|{{{路線色2}}}|{{{路線色}}}}};}} |above = {{{路線名|{{PAGENAME}}}}} |subheader = {{#invoke:InfoboxImage|InfoboxImage|image={{{ロゴ|}}}|size={{{ロゴサイズ|90px}}}|sizedefault=90px|alt=シンボルマーク}} |image = {{#invoke:InfoboxImage|InfoboxImage|image={{{画像|}}}|size={{{画像サイズ|300px}}}|sizedefault=300px|alt={{{画像説明|}}}}} |caption = {{{画像説明<includeonly>|</includeonly>}}} |headerstyle= background: #efefef; |header1 = 基本情報 |label2 = 通称 |data2 = {{{通称<includeonly>|</includeonly>}}} |label3 = 現況 |data3 = {{{現況<includeonly>|</includeonly>}}} |label4 = 国 |data4 = {{{国<includeonly>|</includeonly>}}} |label5 = 所在地 |data5 = {{{所在地<includeonly>|</includeonly>}}} |label7 = 種類 |data7 = {{{種類<includeonly>|</includeonly>}}} |label8 = 路線網 |data8 = {{{路線網<includeonly>|</includeonly>}}} |label9 = 区間 |data9 = {{{区間<includeonly>|</includeonly>}}} |label10 = 起点 |data10 = {{{起点<includeonly>|</includeonly>}}} |label11 = 終点 |data11 = {{{終点<includeonly>|</includeonly>}}} |label12 = 駅数 |data12 = {{{駅数<includeonly>|</includeonly>}}} |label13 = 停留場数 |data13 = {{{停留場数<includeonly>|</includeonly>}}} |label14 = 停留所数 |data14 = {{{停留所数<includeonly>|</includeonly>}}} |label15 = 経由路線 |data15 = {{{経由路線<includeonly>|</includeonly>{{{構成路線|}}}}}} |label16 = 輸送実績 |data16 = {{{輸送実績<includeonly>|</includeonly>}}} |label17 = 1日利用者数 |data17 = {{{1日利用者数<includeonly>|</includeonly>}}} |label18 = 電報略号 |data18 = {{{電報略号<includeonly>|</includeonly>}}} |label19 = 路線記号 |data19 = {{{路線記号<includeonly>|</includeonly>}}} |label20 = 路線番号 |data20 = {{{路線番号<includeonly>|</includeonly>}}} |label21 = 路線色 |data21 = {{{路線色3<includeonly>|</includeonly>}}} |header30 = <!--運営--> |label31 = 開業 |data31 = {{{開業<includeonly>|</includeonly>}}} |label32 = {{{項目1|}}} |data32 = {{{日付1|}}} |label33 = {{{項目2|}}} |data33 = {{{日付2|}}} |label34 = {{{項目3|}}} |data34 = {{{日付3|}}} |label35 = 最終延伸 |data35 = {{{最終延伸<includeonly>|</includeonly>}}} |label36 = 全通 |data36 = {{{全通<includeonly>|</includeonly>}}} |label37 = 休止 |data37 = {{{休止<includeonly>|</includeonly>}}} |label38 = 廃止 |data38 = {{{廃止<includeonly>|</includeonly>}}} |label39 = 再開 |data39 = {{{再開<includeonly>|</includeonly>}}} |label40 = 所有者 |data40 = {{{所有者<includeonly>|</includeonly>}}} |label41 = 運営者 |data41 = {{{運営者<includeonly>|</includeonly>{{{運行者|}}}}}} |label42 = 路線構造 |data42 = {{{路線構造<includeonly>|</includeonly>}}} |label43 = 運転指令所 |data43 = {{{運転指令所<includeonly>|</includeonly>}}} |label44 = 車両基地 |data44 = {{{車両基地<includeonly>|</includeonly>}}} |label45 = 使用車両 |data45 = {{{使用車両<includeonly>|</includeonly>}}} |header50 = 路線諸元 |label51 = 路線距離 |data51 = {{{路線距離<includeonly>|</includeonly>{{{総延長|}}}}}} |label53 = 営業キロ |data53 = {{{営業キロ<includeonly>|</includeonly>}}} |label54 = 軌間 |data54 = {{{軌間<includeonly>|</includeonly>}}} |label57 = 線路数 |data57 = {{{線路数<includeonly>|</includeonly>}}} |label58 = 複線区間 |data58 = {{{複線区間|}}} |label59 = 電化区間 |data59 = {{{電化区間|}}} |label60 = 電化方式 |data60 = {{{電化方式<includeonly>|</includeonly>}}} |label61 = 車両限界 |data61 = {{{車両限界<includeonly>|</includeonly>}}} |label62 = 最大勾配 |data62 = {{{最大勾配<includeonly>|</includeonly>}}} |label63 = 最小曲線半径 |data63 = {{{最小曲線半径<includeonly>|</includeonly>}}} |label64 = 高低差 |data64 = {{{高低差<includeonly>|</includeonly>}}} |label65 = 閉塞方式 |data65 = {{{閉塞方式<includeonly>|</includeonly>}}} |label66 = 保安装置 |data66 = {{{保安装置<includeonly>|</includeonly>}}} |label67 = ラック方式 |data67 = {{{ラック方式<includeonly>|</includeonly>}}} |label68 = 最高速度 |data68 = {{{最高速度<includeonly>|</includeonly>}}} |label69 = 駅間平均長 |data69 = {{{駅間平均長<includeonly>|</includeonly>}}} |label70 = {{{諸元備考<includeonly>|</includeonly>}}} |label71 = このテンプレートはWikipedia[https://ja.wikipedia.org/wiki/Template:%E9%89%84%E9%81%93%E8%B7%AF%E7%B7%9A]からお借りして使用しています。 |data70 = {{{諸元備考内容<includeonly>|</includeonly>}}} |belowstyle = vertical-align: middle; padding:0px; |below = {{#if:{{{路線図<includeonly>|</includeonly>}}}| <table style="width:100%; margin:0; border:none;" class="mw-collapsible {{#switch:{{{路線図表示|}}}|0 |no |#default = no |1 |yes |collapsed = mw-collapsed autocollapse }}"> <tr style="background-color: #efefef"><th>{{#if:{{{路線図名|}}}|{{{路線図名}}}|路線図}}</th></tr> <tr><td style="text-align:center"> {{#invoke:InfoboxImage|InfoboxImage|image={{{路線図<noinclude>|File:Placeholder.svg</noinclude>}}}|size=|sizedefault=300px}}</td></tr> </table>}} }}<noinclude>{{Documentation}}</noinclude> 6c50043b1258b32dc24e0d799e5678655e25ffc1 SR本線 0 7 175 27 2024-02-09T11:49:42Z Kyushujin 2 wikitext text/x-wiki '''SR本線'''(エスアールほんせん)は、[[Scratch中央駅]]から[[蒼原県]][[理間咲市]]の[[理間咲駅]]までを結ぶ[[SR]]の鉄道路線である。 {{Infobox 鉄道路線 |路線名 = SR本線 |路線色 = #2b47ff |路線色2 = #2b47ff |ロゴ = <!-- ロゴ.svg --> |ロゴサイズ = <!--px--> |画像 = <!-- 画像.jpg --> |画像サイズ = <!--px--> |画像説明 = |通称 = |現況 = |国 = 不明 |所在地 = [[蒼原県]] |種類 = |路線網 = |区間 = |起点 = [[Scratch中央駅]] |終点 = [[理間咲駅]] |駅数 = 29駅 |経由路線 = |輸送実績 = |1日利用者数 = |電報略号 = |路線記号 = |路線番号 = |路線色3 = |開業 = 2020年2月26日 |項目1 = |日付1 = |項目2 = |日付2 = |項目3 = |日付3 = |最終延伸 = 2023年9月23日 |全通 = 2023年9月23日 |休止 = |廃止 = |再開 = |所有者 = [[SR]] |運営者 = [[SR]] |運転指令所 = |車両基地 = [[ゴボ車両基地]]、[[大矢車両基地]] |使用車両 = [[SR#車両]]を参照 |路線構造 = |路線距離 = ??km |営業キロ = ??km |軌間 = 1067mm |線路数 = 複線 |複線区間 = 全線 |電化区間 = 全線 |電化方式 = 交流20000V |車両限界 = |最大勾配 = ??‰ |最小曲線半径 = ??m |高低差 = ??m |閉塞方式 = |保安装置 = SR型ATS |ラック方式 = |最高速度 = 100km/h |駅間平均長 = |諸元備考 = |諸元備考内容 = |路線図 = |路線図名 = |路線図表示 = <!--collapsed--> }} ==運行形態== ==駅一覧== 普通、S急行は各駅に停車するため省略。 S急行はScratch中央~氷原間のみ運転。<br> 急行列車の停車駅は「[[おおや]]」「[[かいばる]]」を参照。 ナノ工場~理間咲間は[[蒼原県]]に所在。Scratch中央駅の所在地は不明。 {| class="wikitable" |- ! 駅名 !! 準<br>快<br>速 !! 通<br>勤<br>快<br>速 !! 快<br>速 !! 接続路線・備考 ! colspan="2"|所在地 |- | [[Scratch中央駅]] || ● || ● || ● || [[Scratch鉄道本線]] |- | [[ナノ工場駅]] || | || ● || | || | rowspan="28"|[[蒼原県|蒼<br>原<br>県]] || rowspan="7"|[[氷原市]] |- | [[ゴボ大学駅]] || ● || ● || ● || [[博物館線]] |- | [[スタジオ整理所駅]] || | || | || | |- | [[氷原駅]] || ● || ● || ● || [[地平線]] |- | [[西氷原駅]] || | || | || | || |- | [[スリンタウン駅]] || ● || ● || ● || |- | [[南葉駅]] || | || | || | || |- | [[熊壁駅]] || ● || ● || ● || | rowspan="3"|[[熊壁市]] |- | [[公原駅]] || | || ● || | || |- | [[大矢口駅]] || ● || ● || ● || [[上野線]] |- | [[江立駅]] || ● || | || | || | rowspan="6"|[[大矢町]] |- | [[大矢駅]] || ● || ● || ● || |- | [[中崎駅]] || ● || ● || | || |- | [[野岡駅]] || ● || ● || ● || |- | [[北野岡駅]] || ● || | || | || |- | [[和原駅]] || ● || ● || | || |- | [[南与川駅]] || ● || | || | || | rowspan="5"|[[与川町]] |- | [[与川駅]] || ● || ● || ● || |- | [[片砂駅]] || ● || | || | || |- | [[人空温泉駅]] || ● || ● || ● || |- | [[差家駅]] || ● || ● || ● || |- | [[東多穂駅]] || ● || ● || | || | rowspan="7"|[[理間咲市]] |- | [[多穂駅]] || ● || ● || ● || |- | [[大上駅]] || | || | || | || |- | [[豆田駅]] || ● || ● || ● || |- | [[花原駅]] || | || | || | || |- | [[山沢駅]] || | || | || | || |- | [[理間咲駅]] || ● || ● || ● || |} 156bfd41a6ed8c62b98b59f767119725f876f9c3 180 175 2024-02-10T01:04:00Z Kyushujin 2 /* 駅一覧 */ wikitext text/x-wiki '''SR本線'''(エスアールほんせん)は、[[Scratch中央駅]]から[[蒼原県]][[理間咲市]]の[[理間咲駅]]までを結ぶ[[SR]]の鉄道路線である。 {{Infobox 鉄道路線 |路線名 = SR本線 |路線色 = #2b47ff |路線色2 = #2b47ff |ロゴ = <!-- ロゴ.svg --> |ロゴサイズ = <!--px--> |画像 = <!-- 画像.jpg --> |画像サイズ = <!--px--> |画像説明 = |通称 = |現況 = |国 = 不明 |所在地 = [[蒼原県]] |種類 = |路線網 = |区間 = |起点 = [[Scratch中央駅]] |終点 = [[理間咲駅]] |駅数 = 29駅 |経由路線 = |輸送実績 = |1日利用者数 = |電報略号 = |路線記号 = |路線番号 = |路線色3 = |開業 = 2020年2月26日 |項目1 = |日付1 = |項目2 = |日付2 = |項目3 = |日付3 = |最終延伸 = 2023年9月23日 |全通 = 2023年9月23日 |休止 = |廃止 = |再開 = |所有者 = [[SR]] |運営者 = [[SR]] |運転指令所 = |車両基地 = [[ゴボ車両基地]]、[[大矢車両基地]] |使用車両 = [[SR#車両]]を参照 |路線構造 = |路線距離 = ??km |営業キロ = ??km |軌間 = 1067mm |線路数 = 複線 |複線区間 = 全線 |電化区間 = 全線 |電化方式 = 交流20000V |車両限界 = |最大勾配 = ??‰ |最小曲線半径 = ??m |高低差 = ??m |閉塞方式 = |保安装置 = SR型ATS |ラック方式 = |最高速度 = 100km/h |駅間平均長 = |諸元備考 = |諸元備考内容 = |路線図 = |路線図名 = |路線図表示 = <!--collapsed--> }} ==運行形態== ==駅一覧== 普通、S急行は各駅に停車するため省略。 S急行はScratch中央~氷原間のみ運転。<br> 急行列車の停車駅は「[[おおや]]」「[[かいばる]]」を参照。 ナノ工場~理間咲間は[[蒼原県]]に所在。Scratch中央駅の所在地は不明。 {| class="wikitable" |- ! 駅名 !! style="width:1em; background-color:#feb;" |準<br>快<br>速 !! style="width:1em; background-color:#9effff;|通<br>勤<br>快<br>速 !! style="width:1em; background-color:#9e9eff;|快<br>速 !! 接続路線・備考 ! colspan="2"|所在地 |- | [[Scratch中央駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[Scratch鉄道本線]] |- | [[ナノ工場駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || | rowspan="28"|[[蒼原県|蒼<br>原<br>県]] || rowspan="7"|[[氷原市]] |- | [[ゴボ大学駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[博物館線]] |- | [[スタジオ整理所駅]] || style="width:1em; background-color:#feb;" |||| style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| |- | [[氷原駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[地平線]] |- | [[西氷原駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[スリンタウン駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[南葉駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[熊壁駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || | rowspan="3"|[[熊壁市]] |- | [[公原駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[大矢口駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[上野線]] |- | [[江立駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || | rowspan="6"|[[大矢町]] |- | [[大矢駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[中崎駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[野岡駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[北野岡駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[和原駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[南与川駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || | rowspan="5"|[[与川町]] |- | [[与川駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[片砂駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[人空温泉駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[差家駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[東多穂駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || | rowspan="7"|[[理間咲市]] |- | [[多穂駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[大上駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[豆田駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[花原駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[山沢駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[理間咲駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |} 5e0269a588750cab33c90bf5fb1a5aa5d03c4476 181 180 2024-02-10T01:08:13Z Kyushujin 2 wikitext text/x-wiki '''SR本線'''(エスアールほんせん)は、[[Scratch中央駅]]から[[蒼原県]][[理間咲市]]の[[理間咲駅]]までを結ぶ[[SR]]の鉄道路線である。 {{Infobox 鉄道路線 |路線名 = SR本線 |路線色 = #2b47ff |路線色2 = #2b47ff |ロゴ = <!-- ロゴ.svg --> |ロゴサイズ = <!--px--> |画像 = <!-- 画像.jpg --> |画像サイズ = <!--px--> |画像説明 = |通称 = |現況 = |国 = 不明 |所在地 = [[蒼原県]] |種類 = |路線網 = |区間 = |起点 = [[Scratch中央駅]] |終点 = [[理間咲駅]] |駅数 = 29駅 |経由路線 = |輸送実績 = |1日利用者数 = |電報略号 = |路線記号 = |路線番号 = |路線色3 = |開業 = 2020年2月26日 |項目1 = |日付1 = |項目2 = |日付2 = |項目3 = |日付3 = |最終延伸 = 2023年9月23日 |全通 = 2023年9月23日 |休止 = |廃止 = |再開 = |所有者 = [[SR]] |運営者 = [[SR]] |運転指令所 = |車両基地 = [[ゴボ車両基地]]、[[大矢車両基地]] |使用車両 = [[SR#車両]]を参照 |路線構造 = |路線距離 = ??km |営業キロ = ??km |軌間 = 1067mm |線路数 = 複線 |複線区間 = 全線 |電化区間 = 全線 |電化方式 = 交流20000V |車両限界 = |最大勾配 = ??‰ |最小曲線半径 = ??m |高低差 = ??m |閉塞方式 = |保安装置 = SR型ATS |ラック方式 = |最高速度 = 100km/h |駅間平均長 = |諸元備考 = |諸元備考内容 = |路線図 = |路線図名 = |路線図表示 = <!--collapsed--> }} ==運行形態== ==駅一覧== 普通、S急行は各駅に停車するため省略。 S急行はScratch中央~氷原間のみ運転。<br> 急行列車の停車駅は「[[おおや]]」「[[かいばる]]」を参照。 ナノ工場~理間咲間は[[蒼原県]]に所在。Scratch中央駅の所在地は不明。 {| class="wikitable" |- ! 駅名 !! style="width:1em; background-color:#feb;" |準<br>快<br>速 !! style="width:1em; background-color:#9effff;|通<br>勤<br>快<br>速 !! style="width:1em; background-color:#9e9eff;|快<br>速 !! 接続路線・備考 ! colspan="2"|所在地 |- | [[Scratch中央駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[Scratch鉄道本線]] |- | [[ナノ工場駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || | rowspan="28"|[[蒼原県|蒼<br>原<br>県]] || rowspan="7"|[[氷原市]] |- | [[ゴボ大学駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[博物館線]] |- | [[スタジオ整理所駅]] || style="width:1em; background-color:#feb;" |||| style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| |- | [[氷原駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[地平線]] |- | [[西氷原駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[スリンタウン駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[南葉駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[熊壁駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || | rowspan="3"|[[熊壁市]] |- | [[公原駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[大矢口駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[上野線]] |- | [[江立駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || | rowspan="6"|[[大矢町]] |- | [[大矢駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[中崎駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[野岡駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[北野岡駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[和原駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[南与川駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || | rowspan="5"|[[与川町]] |- | [[与川駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[片砂駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[人空温泉駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[差家駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[東多穂駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || | rowspan="7"|[[理間咲市]] |- | [[多穂駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[大上駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[豆田駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[花原駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[山沢駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[理間咲駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |} 0d8fc78f6ddfaf495fa9b799779ba027504d1b47 182 181 2024-02-10T01:09:07Z Kyushujin 2 wikitext text/x-wiki '''SR本線'''(エスアールほんせん)は、[[Scratch中央駅]]から[[蒼原県]][[理間咲市]]の[[理間咲駅]]までを結ぶ[[SR]]の鉄道路線である。 {{Infobox 鉄道路線 |路線名 = SR本線 |路線色 = #2b47ff |路線色2 = #2b47ff |ロゴ = <!-- ロゴ.svg --> |ロゴサイズ = <!--px--> |画像 = <!-- 画像.jpg --> |画像サイズ = <!--px--> |画像説明 = |通称 = |現況 = |国 = 不明 |所在地 = [[蒼原県]] |種類 = |路線網 = |区間 = |起点 = [[Scratch中央駅]] |終点 = [[理間咲駅]] |駅数 = 29駅 |経由路線 = |輸送実績 = |1日利用者数 = |電報略号 = |路線記号 = |路線番号 = |路線色3 = |開業 = 2020年2月26日 |項目1 = |日付1 = |項目2 = |日付2 = |項目3 = |日付3 = |最終延伸 = 2023年9月23日 |全通 = 2023年9月23日 |休止 = |廃止 = |再開 = |所有者 = [[SR]] |運営者 = [[SR]] |運転指令所 = |車両基地 = [[ゴボ車両基地]]、[[大矢車両基地]] |使用車両 = [[SR#車両]]を参照 |路線構造 = |路線距離 = ??km |営業キロ = ??km |軌間 = 1067mm |線路数 = 複線 |複線区間 = 全線 |電化区間 = 全線 |電化方式 = 交流20000V |車両限界 = |最大勾配 = ??‰ |最小曲線半径 = ??m |高低差 = ??m |閉塞方式 = |保安装置 = SR型ATS |ラック方式 = |最高速度 = 100km/h |駅間平均長 = |諸元備考 = |諸元備考内容 = |路線図 = |路線図名 = |路線図表示 = <!--collapsed--> }} ==運行形態== ==駅一覧== 普通、S急行は各駅に停車するため省略。 S急行はScratch中央~氷原間のみ運転。<br> 急行列車の停車駅は「[[おおや]]」「[[かいばる]]」を参照。 ナノ工場~理間咲間は[[蒼原県]]に所在。Scratch中央駅の所在地は不明。 {| class="wikitable" |- ! 駅名 !! style="width:1em; background-color:#feb;" |準<br>快<br>速 !! style="width:1em; background-color:#9effff;|通<br>勤<br>快<br>速 !! style="width:1em; background-color:#9e9eff;|快<br>速 !! 接続路線・備考 ! colspan="2"|所在地 |- | [[Scratch中央駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[Scratch鉄道本線]] |- | [[ナノ工場駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || | rowspan="28"|[[蒼原県|蒼<br>原<br>県]] || rowspan="7"|[[氷原市]] |- | [[ゴボ大学駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|● || [[博物館線]] |- | [[スタジオ整理所駅]] || style="width:1em; background-color:#feb;" |||| style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| |- | [[氷原駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[地平線]] |- | [[西氷原駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[スリンタウン駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[南葉駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[熊壁駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || | rowspan="3"|[[熊壁市]] |- | [[公原駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[大矢口駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[上野線]] |- | [[江立駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || | rowspan="6"|[[大矢町]] |- | [[大矢駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[中崎駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[野岡駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[北野岡駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[和原駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[南与川駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || | rowspan="5"|[[与川町]] |- | [[与川駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[片砂駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[人空温泉駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[差家駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[東多穂駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || | rowspan="7"|[[理間咲市]] |- | [[多穂駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[大上駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[豆田駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[花原駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[山沢駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[理間咲駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |} 644b50c9f39c011e2448e5a9a2360208dd83c551 183 182 2024-02-10T03:03:56Z Kyushujin 2 wikitext text/x-wiki '''SR本線'''(エスアールほんせん)は、[[Scratch中央駅]]から[[蒼原県]][[理間咲市]]の[[理間咲駅]]までを結ぶ[[SR]]の鉄道路線である。 {{Infobox 鉄道路線 |路線名 = SR本線 |路線色 = #2b47ff |路線色2 = #2b47ff |ロゴ = <!-- ロゴ.svg --> |ロゴサイズ = <!--px--> |画像 = <!-- 画像.jpg --> |画像サイズ = <!--px--> |画像説明 = |通称 = |現況 = |国 = 不明 |所在地 = [[蒼原県]] |種類 = |路線網 = |区間 = |起点 = [[Scratch中央駅]] |終点 = [[理間咲駅]] |駅数 = 29駅 |経由路線 = |輸送実績 = |1日利用者数 = |電報略号 = |路線記号 = |路線番号 = |路線色3 = |開業 = 2020年2月26日 |項目1 = |日付1 = |項目2 = |日付2 = |項目3 = |日付3 = |最終延伸 = 2023年9月23日 |全通 = 2023年9月23日 |休止 = |廃止 = |再開 = |所有者 = [[SR]] |運営者 = [[SR]] |運転指令所 = |車両基地 = [[ゴボ車両基地]]、[[大矢車両基地]] |使用車両 = [[SR#車両]]を参照 |路線構造 = |路線距離 = ??km |営業キロ = ??km |軌間 = 1067mm |線路数 = 複線 |複線区間 = 全線 |電化区間 = 全線 |電化方式 = 交流20000V |車両限界 = |最大勾配 = ??‰ |最小曲線半径 = ??m |高低差 = ??m |閉塞方式 = |保安装置 = SR型ATS |ラック方式 = |最高速度 = 100km/h |駅間平均長 = |諸元備考 = |諸元備考内容 = |路線図 = |路線図名 = |路線図表示 = <!--collapsed--> }} ==運行形態== ==駅一覧== 普通、S急行は各駅に停車するため省略。 S急行はScratch中央~氷原間のみ運転。<br> 急行列車の停車駅は「[[おおや]]」「[[かいばる]]」を参照。 ナノ工場~理間咲間は[[蒼原県]]に所在。Scratch中央駅の所在地は不明。 {| class="wikitable" |- ! 駅名 !! style="width:1em; background-color:#feb;" |準<br>快<br>速 !! style="width:1em; background-color:#9effff;|通<br>勤<br>快<br>速 !! style="width:1em; background-color:#9e9eff;|快<br>速 !! 接続路線・備考 ! colspan="2"|所在地 |- | [[Scratch中央駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[Scratch鉄道]]:[[本線]] |- | [[ナノ工場駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || | rowspan="28"|[[蒼原県|蒼<br>原<br>県]] || rowspan="7"|[[氷原市]] |- | [[ゴボ大学駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|● || [[SR]]:[[博物館線]] |- | [[スタジオ整理所駅]] || style="width:1em; background-color:#feb;" |||| style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| |- | [[氷原駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || SR:[[地平線]] |- | [[西氷原駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[スリンタウン駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[南葉駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[熊壁駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || | rowspan="3"|[[熊壁市]] |- | [[公原駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[大矢口駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || SR:[[上野線]] |- | [[江立駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || | rowspan="6"|[[大矢町]] |- | [[大矢駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[中崎駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[野岡駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[北野岡駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[和原駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || |- | [[南与川駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || | rowspan="5"|[[与川町]] |- | [[与川駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[片砂駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[人空温泉駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[差家駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[東多穂駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|| || | rowspan="7"|[[理間咲市]] |- | [[多穂駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || SR:[[大良線]] |- | [[大上駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[豆田駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || |- | [[花原駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[山沢駅]] || style="width:1em; background-color:#feb;" || || style="width:1em; background-color:#9effff;|| || style="width:1em; background-color:#9e9eff;|| || |- | [[理間咲駅]] || style="width:1em; background-color:#feb;" |● || style="width:1em; background-color:#9effff;|● || style="width:1em; background-color:#9e9eff;|● || [[理間咲電鉄]]:[[馬川線]]…[[理間咲駅#理間咲駅停留場|理間咲駅停留場]] |} 3e352d789dcd9ebcb6a1baca32b3134562e58f0e